From bc3de08c2be1b46276b2d0c61d8eb5d55f35f442 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Numbus?= Date: Wed, 25 Feb 2026 13:13:46 +0100 Subject: [PATCH] Added top-level `config`. --- modules/hardware/cpu.nix | 8 +++--- modules/misc/internationalisation.nix | 34 +++++++++++++----------- modules/misc/power.nix | 38 ++++++++++++++------------- modules/misc/update.nix | 32 +++++++++++----------- modules/services/immich.nix | 4 +-- 5 files changed, 62 insertions(+), 54 deletions(-) diff --git a/modules/hardware/cpu.nix b/modules/hardware/cpu.nix index 8dcb9dc..d3fe470 100644 --- a/modules/hardware/cpu.nix +++ b/modules/hardware/cpu.nix @@ -1,7 +1,9 @@ { config, ... }: { - hardware.enableRedistributableFirmware = true; - hardware.cpu.intel.updateMicrocode = true; - hardware.cpu.amd.updateMicrocode = true; + config = { + hardware.enableRedistributableFirmware = true; + hardware.cpu.intel.updateMicrocode = true; + hardware.cpu.amd.updateMicrocode = true; + }; } \ No newline at end of file diff --git a/modules/misc/internationalisation.nix b/modules/misc/internationalisation.nix index d047f55..4eff542 100644 --- a/modules/misc/internationalisation.nix +++ b/modules/misc/internationalisation.nix @@ -1,22 +1,24 @@ { config, lib, ... }: { - i18n.defaultLocale = "${config.numbus.locale}.UTF-8"; - i18n.extraLocaleSettings = { - LC_ADDRESS = "${config.numbus.locale}.UTF-8"; - LC_IDENTIFICATION = "${config.numbus.locale}.UTF-8"; - LC_MEASUREMENT = "${config.numbus.locale}.UTF-8"; - LC_MONETARY = "${config.numbus.locale}.UTF-8"; - LC_NAME = "${config.numbus.locale}.UTF-8"; - LC_NUMERIC = "${config.numbus.locale}.UTF-8"; - LC_PAPER = "${config.numbus.locale}.UTF-8"; - LC_TELEPHONE = "${config.numbus.locale}.UTF-8"; - LC_TIME = "${config.numbus.locale}.UTF-8"; - }; + config = { + i18n.defaultLocale = "${config.numbus.locale}.UTF-8"; + i18n.extraLocaleSettings = { + LC_ADDRESS = "${config.numbus.locale}.UTF-8"; + LC_IDENTIFICATION = "${config.numbus.locale}.UTF-8"; + LC_MEASUREMENT = "${config.numbus.locale}.UTF-8"; + LC_MONETARY = "${config.numbus.locale}.UTF-8"; + LC_NAME = "${config.numbus.locale}.UTF-8"; + LC_NUMERIC = "${config.numbus.locale}.UTF-8"; + LC_PAPER = "${config.numbus.locale}.UTF-8"; + LC_TELEPHONE = "${config.numbus.locale}.UTF-8"; + LC_TIME = "${config.numbus.locale}.UTF-8"; + }; - console.keyMap = lib.toLower config.numbus.language; - services.xserver.xkb = { - layout = lib.toLower config.numbus.language; - variant = ""; + console.keyMap = lib.toLower config.numbus.language; + services.xserver.xkb = { + layout = lib.toLower config.numbus.language; + variant = ""; + }; }; } \ No newline at end of file diff --git a/modules/misc/power.nix b/modules/misc/power.nix index 399bba4..f1c73f9 100644 --- a/modules/misc/power.nix +++ b/modules/misc/power.nix @@ -5,24 +5,26 @@ let in { - systemd.services.hd-idle = { - description = "External HD spin down daemon"; - wantedBy = [ "multi-user.target" ]; - serviceConfig = { - Type = "simple"; - ExecStart = - let - idleTime = toString 1800; - hardDriveParameter = lib.strings.concatMapStringsSep " " (x: "-a ${x} -i ${idleTime}") hardDrives; - in - "${pkgs.hd-idle}/bin/hd-idle -i 0 ${hardDriveParameter}"; + config = { + systemd.services.hd-idle = { + description = "External HD spin down daemon"; + wantedBy = [ "multi-user.target" ]; + serviceConfig = { + Type = "simple"; + ExecStart = + let + idleTime = toString 1800; + hardDriveParameter = lib.strings.concatMapStringsSep " " (x: "-a ${x} -i ${idleTime}") hardDrives; + in + "${pkgs.hd-idle}/bin/hd-idle -i 0 ${hardDriveParameter}"; + }; }; - }; - services.autoaspm.enable = true; - powerManagement.powertop.enable = true; - boot.kernelParams = [ - "pcie_aspm=force" - "consoleblank=60" - ]; + services.autoaspm.enable = true; + powerManagement.powertop.enable = true; + boot.kernelParams = [ + "pcie_aspm=force" + "consoleblank=60" + ]; + }; } \ No newline at end of file diff --git a/modules/misc/update.nix b/modules/misc/update.nix index be62248..26b22dd 100644 --- a/modules/misc/update.nix +++ b/modules/misc/update.nix @@ -1,21 +1,23 @@ { config, inputs, ... }: { - system.autoUpgrade = { - enable = true; - allowReboot = false; - flake = inputs.self.outPath; - flags = [ "--print-build-logs" ]; - dates = "02:00"; - randomizedDelaySec = "45min"; - }; + config = { + system.autoUpgrade = { + enable = true; + allowReboot = false; + flake = inputs.self.outPath; + flags = [ "--print-build-logs" ]; + dates = "02:00"; + randomizedDelaySec = "45min"; + }; - nix.gc = { - automatic = true; - dates = "weekly"; - options = "--delete-older-than 7d"; - }; + nix.gc = { + automatic = true; + dates = "weekly"; + options = "--delete-older-than 7d"; + }; - nix.settings.experimental-features = [ "nix-command" "flakes" ]; - nix.settings.auto-optimise-store = true; + nix.settings.experimental-features = [ "nix-command" "flakes" ]; + nix.settings.auto-optimise-store = true; + }; } \ No newline at end of file diff --git a/modules/services/immich.nix b/modules/services/immich.nix index 9758d7b..dd727b5 100644 --- a/modules/services/immich.nix +++ b/modules/services/immich.nix @@ -9,7 +9,7 @@ let databaseVersion = "14-vectorchord0.4.3-pgvectors0.2.0@sha256:bcf63357191b76a916ae5eb93464d65c07511da41e3bf7a8416db519b40b1c23"; # Helper helper = import ./lib.nix { inherit config pkgs lib; }; - cfg = config.numbus.services.${name}; + cfg = config.numbus.services.immich; # Container configuration name = "immich"; in @@ -29,7 +29,7 @@ helper.mkPodmanService { DB_HOSTNAME = "immich-database"; UPLOAD_LOCATION = "${cfg.dataDir}"; DB_DATA_LOCATION = "${cfg.configDir}/database"; - TZ = "${time.timeZone}"; + TZ = "${config.time.timeZone}"; }; dirPermissions = [ "100999:users ${cfg.dataDir}"