From c2977f134e5f2eb7614bd87ca87df25d76127584 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Thu, 28 Mar 2013 13:35:07 +0100 Subject: [PATCH] nix-gc.timer: Fix the start time --- modules/services/misc/nix-gc.nix | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/modules/services/misc/nix-gc.nix b/modules/services/misc/nix-gc.nix index 27bcfafa20f..dfc4fd3c2ff 100644 --- a/modules/services/misc/nix-gc.nix +++ b/modules/services/misc/nix-gc.nix @@ -21,7 +21,7 @@ in }; dates = mkOption { - default = "00:43"; + default = "03:15"; type = types.uniq types.string; description = '' Specification (in the format described by @@ -48,18 +48,22 @@ in ###### implementation - config = { + config = mkMerge [ - #systemd.timers.nix-gc.enable = cfg.automatic; - systemd.timers.nix-gc.enable = true; - systemd.timers.nix-gc.timerConfig.OnCalendar = cfg.dates; + { systemd.services.nix-gc = + { description = "Nix Garbage Collector"; + path = [ config.environment.nix ]; + script = "exec nix-collect-garbage ${cfg.options}"; + }; + } - systemd.services.nix-gc = - { description = "Nix Garbage Collector"; - path = [ config.environment.nix ]; - script = "exec nix-collect-garbage ${cfg.options}"; - }; + (mkIf cfg.automatic { + systemd.timers.nix-gc = + { wantedBy = [ "timers.target" ]; + timerConfig.OnCalendar = cfg.dates; + }; + }) - }; + ]; }