nix: add store optimisation and tweak garbage collection

This commit is contained in:
2026-05-31 15:37:51 +02:00
parent 4fcbc31629
commit 9e6e278c72
+9 -1
View File
@@ -6,10 +6,18 @@
nix.settings.cores = 6; nix.settings.cores = 6;
}; };
flake.nixosModules.nixUtils = {pkgs-unstable, ...}: { flake.nixosModules.nixUtils = {pkgs-unstable, ...}: {
# Optimise the nix store
nix.optimise = {
automatic = true;
persistent = true;
randomDelaySec = "30min";
dates = "Thu *-*-* 16:00:00";
};
# Garbage collector of generations # Garbage collector of generations
nix.gc = { nix.gc = {
automatic = true; automatic = true;
dates = "weekly"; dates = "Wed *-*-* 16:00:00";
persistent = true;
options = "--delete-older-than 7d"; # every week delete generations older than a month options = "--delete-older-than 7d"; # every week delete generations older than a month
}; };