From af6732e5037ef81479f2dfd5e48921b380a80b7a Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Fri, 18 Dec 2015 11:25:48 +0100 Subject: [PATCH] nixos autoUpgrade: add a 'dates' option (cherry picked from commit 80917d2473d321d7a990cf991c6353547976638c) Originally merged #11808 to release-15.09 directly. Close #11821. --- nixos/modules/installer/tools/auto-upgrade.nix | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/nixos/modules/installer/tools/auto-upgrade.nix b/nixos/modules/installer/tools/auto-upgrade.nix index e14653dc4eb0..4ef5fa8bc1d4 100644 --- a/nixos/modules/installer/tools/auto-upgrade.nix +++ b/nixos/modules/installer/tools/auto-upgrade.nix @@ -42,6 +42,17 @@ let cfg = config.system.autoUpgrade; in ''; }; + dates = mkOption { + default = "04:40"; + type = types.str; + description = '' + Specification (in the format described by + systemd.time + 5) of the time at + which the update will occur. + ''; + }; + }; }; @@ -73,7 +84,7 @@ let cfg = config.system.autoUpgrade; in ${config.system.build.nixos-rebuild}/bin/nixos-rebuild switch ${toString cfg.flags} ''; - startAt = mkIf cfg.enable "04:40"; + startAt = optionalString cfg.enable cfg.dates; }; };