Added top-level config.

This commit is contained in:
Raphaël Numbus
2026-02-25 13:13:46 +01:00
parent dd47755f74
commit bc3de08c2b
5 changed files with 62 additions and 54 deletions
+5 -3
View File
@@ -1,7 +1,9 @@
{ config, ... }: { config, ... }:
{ {
hardware.enableRedistributableFirmware = true; config = {
hardware.cpu.intel.updateMicrocode = true; hardware.enableRedistributableFirmware = true;
hardware.cpu.amd.updateMicrocode = true; hardware.cpu.intel.updateMicrocode = true;
hardware.cpu.amd.updateMicrocode = true;
};
} }
+18 -16
View File
@@ -1,22 +1,24 @@
{ config, lib, ... }: { config, lib, ... }:
{ {
i18n.defaultLocale = "${config.numbus.locale}.UTF-8"; config = {
i18n.extraLocaleSettings = { i18n.defaultLocale = "${config.numbus.locale}.UTF-8";
LC_ADDRESS = "${config.numbus.locale}.UTF-8"; i18n.extraLocaleSettings = {
LC_IDENTIFICATION = "${config.numbus.locale}.UTF-8"; LC_ADDRESS = "${config.numbus.locale}.UTF-8";
LC_MEASUREMENT = "${config.numbus.locale}.UTF-8"; LC_IDENTIFICATION = "${config.numbus.locale}.UTF-8";
LC_MONETARY = "${config.numbus.locale}.UTF-8"; LC_MEASUREMENT = "${config.numbus.locale}.UTF-8";
LC_NAME = "${config.numbus.locale}.UTF-8"; LC_MONETARY = "${config.numbus.locale}.UTF-8";
LC_NUMERIC = "${config.numbus.locale}.UTF-8"; LC_NAME = "${config.numbus.locale}.UTF-8";
LC_PAPER = "${config.numbus.locale}.UTF-8"; LC_NUMERIC = "${config.numbus.locale}.UTF-8";
LC_TELEPHONE = "${config.numbus.locale}.UTF-8"; LC_PAPER = "${config.numbus.locale}.UTF-8";
LC_TIME = "${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; console.keyMap = lib.toLower config.numbus.language;
services.xserver.xkb = { services.xserver.xkb = {
layout = lib.toLower config.numbus.language; layout = lib.toLower config.numbus.language;
variant = ""; variant = "";
};
}; };
} }
+20 -18
View File
@@ -5,24 +5,26 @@ let
in in
{ {
systemd.services.hd-idle = { config = {
description = "External HD spin down daemon"; systemd.services.hd-idle = {
wantedBy = [ "multi-user.target" ]; description = "External HD spin down daemon";
serviceConfig = { wantedBy = [ "multi-user.target" ];
Type = "simple"; serviceConfig = {
ExecStart = Type = "simple";
let ExecStart =
idleTime = toString 1800; let
hardDriveParameter = lib.strings.concatMapStringsSep " " (x: "-a ${x} -i ${idleTime}") hardDrives; idleTime = toString 1800;
in hardDriveParameter = lib.strings.concatMapStringsSep " " (x: "-a ${x} -i ${idleTime}") hardDrives;
"${pkgs.hd-idle}/bin/hd-idle -i 0 ${hardDriveParameter}"; in
"${pkgs.hd-idle}/bin/hd-idle -i 0 ${hardDriveParameter}";
};
}; };
};
services.autoaspm.enable = true; services.autoaspm.enable = true;
powerManagement.powertop.enable = true; powerManagement.powertop.enable = true;
boot.kernelParams = [ boot.kernelParams = [
"pcie_aspm=force" "pcie_aspm=force"
"consoleblank=60" "consoleblank=60"
]; ];
};
} }
+17 -15
View File
@@ -1,21 +1,23 @@
{ config, inputs, ... }: { config, inputs, ... }:
{ {
system.autoUpgrade = { config = {
enable = true; system.autoUpgrade = {
allowReboot = false; enable = true;
flake = inputs.self.outPath; allowReboot = false;
flags = [ "--print-build-logs" ]; flake = inputs.self.outPath;
dates = "02:00"; flags = [ "--print-build-logs" ];
randomizedDelaySec = "45min"; dates = "02:00";
}; randomizedDelaySec = "45min";
};
nix.gc = { nix.gc = {
automatic = true; automatic = true;
dates = "weekly"; dates = "weekly";
options = "--delete-older-than 7d"; options = "--delete-older-than 7d";
}; };
nix.settings.experimental-features = [ "nix-command" "flakes" ]; nix.settings.experimental-features = [ "nix-command" "flakes" ];
nix.settings.auto-optimise-store = true; nix.settings.auto-optimise-store = true;
};
} }
+2 -2
View File
@@ -9,7 +9,7 @@ let
databaseVersion = "14-vectorchord0.4.3-pgvectors0.2.0@sha256:bcf63357191b76a916ae5eb93464d65c07511da41e3bf7a8416db519b40b1c23"; databaseVersion = "14-vectorchord0.4.3-pgvectors0.2.0@sha256:bcf63357191b76a916ae5eb93464d65c07511da41e3bf7a8416db519b40b1c23";
# Helper # Helper
helper = import ./lib.nix { inherit config pkgs lib; }; helper = import ./lib.nix { inherit config pkgs lib; };
cfg = config.numbus.services.${name}; cfg = config.numbus.services.immich;
# Container configuration # Container configuration
name = "immich"; name = "immich";
in in
@@ -29,7 +29,7 @@ helper.mkPodmanService {
DB_HOSTNAME = "immich-database"; DB_HOSTNAME = "immich-database";
UPLOAD_LOCATION = "${cfg.dataDir}"; UPLOAD_LOCATION = "${cfg.dataDir}";
DB_DATA_LOCATION = "${cfg.configDir}/database"; DB_DATA_LOCATION = "${cfg.configDir}/database";
TZ = "${time.timeZone}"; TZ = "${config.time.timeZone}";
}; };
dirPermissions = [ dirPermissions = [
"100999:users ${cfg.dataDir}" "100999:users ${cfg.dataDir}"