From 4f053b60ae265a038f950e8535b37c092a0e9b35 Mon Sep 17 00:00:00 2001 From: isabel Date: Thu, 8 May 2025 13:21:13 +0100 Subject: [PATCH] nixos/nix-gc: allow dates to be a list --- nixos/modules/services/misc/nix-gc.nix | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/nixos/modules/services/misc/nix-gc.nix b/nixos/modules/services/misc/nix-gc.nix index 56d176d81d36..034b044fbafe 100644 --- a/nixos/modules/services/misc/nix-gc.nix +++ b/nixos/modules/services/misc/nix-gc.nix @@ -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 {