nixos/nix-gc: allow dates to be a list

This commit is contained in:
isabel
2025-05-18 11:35:26 +01:00
parent 6724b0bfcb
commit 4f053b60ae
+4 -3
View File
@@ -19,8 +19,9 @@ in
};
dates = lib.mkOption {
type = lib.types.singleLineStr;
default = "03:15";
type = with lib.types; either singleLineStr (listOf str);
apply = lib.toList;
default = [ "03:15" ];
example = "weekly";
description = ''
How often or when garbage collection is performed. For most desktop and server systems
@@ -86,7 +87,7 @@ in
description = "Nix Garbage Collector";
script = "exec ${config.nix.package.out}/bin/nix-collect-garbage ${cfg.options}";
serviceConfig.Type = "oneshot";
startAt = lib.optional cfg.automatic cfg.dates;
startAt = lib.optionals cfg.automatic cfg.dates;
};
systemd.timers.nix-gc = lib.mkIf cfg.automatic {