Specify times for nix-gc and optimise (assume UTC)

This commit is contained in:
2026-05-17 09:02:19 +00:00
parent 19a14a2611
commit e6a7f3f441
2 changed files with 31 additions and 6 deletions

View File

@@ -1,7 +1,18 @@
_: { { lib, options, ... }:
{
nix.gc = { nix.gc = {
automatic = true; automatic = true;
dates = "weekly";
options = "--delete-older-than 60d"; options = "--delete-older-than 60d";
}
// lib.optionalAttrs (options.nix.gc ? dates) {
# NixOS
dates = lib.mkDefault "00:15";
}
// lib.optionalAttrs (options.nix.gc ? interval) {
# Darwin
interval = lib.mkDefault {
Hour = 0;
Minute = 15;
};
}; };
} }

View File

@@ -1,4 +1,5 @@
_: { { lib, options, ... }:
{
nix.settings = { nix.settings = {
extra-experimental-features = [ extra-experimental-features = [
"nix-command" "nix-command"
@@ -11,7 +12,20 @@ _: {
download-buffer-size = 1 * 1024 * 1024 * 1024; download-buffer-size = 1 * 1024 * 1024 * 1024;
}; };
# Instead of nix.settings.auto-optimise-store, which adds overhead to each nix.optimise = {
# build. # Instead of nix.settings.auto-optimise-store, which adds overhead to each
nix.optimise.automatic = true; # build.
automatic = true;
}
// lib.optionalAttrs (options.nix.optimise ? dates) {
# NixOS
dates = lib.mkDefault "00:45";
}
// lib.optionalAttrs (options.nix.optimise ? interval) {
# Darwin
interval = lib.mkDefault {
Hour = 0;
Minute = 45;
};
};
} }