summary refs log tree commit diff
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2015-12-18 11:25:48 +0100
committerVladimír Čunát <vcunat@gmail.com>2015-12-19 08:46:13 +0100
commitaf6732e5037ef81479f2dfd5e48921b380a80b7a (patch)
tree73bc4e9a351e31585f31db8e4ecf51638d9f073e
parentb3b7f9f37f8c134aa22b66ec6a0a1d555f1638bb (diff)
downloadnixpkgs-af6732e5037ef81479f2dfd5e48921b380a80b7a.tar
nixpkgs-af6732e5037ef81479f2dfd5e48921b380a80b7a.tar.gz
nixpkgs-af6732e5037ef81479f2dfd5e48921b380a80b7a.tar.bz2
nixpkgs-af6732e5037ef81479f2dfd5e48921b380a80b7a.tar.lz
nixpkgs-af6732e5037ef81479f2dfd5e48921b380a80b7a.tar.xz
nixpkgs-af6732e5037ef81479f2dfd5e48921b380a80b7a.tar.zst
nixpkgs-af6732e5037ef81479f2dfd5e48921b380a80b7a.zip
nixos autoUpgrade: add a 'dates' option
(cherry picked from commit 80917d2473d321d7a990cf991c6353547976638c)
Originally merged #11808 to release-15.09 directly. Close #11821.
-rw-r--r--nixos/modules/installer/tools/auto-upgrade.nix13
1 files changed, 12 insertions, 1 deletions
diff --git a/nixos/modules/installer/tools/auto-upgrade.nix b/nixos/modules/installer/tools/auto-upgrade.nix
index e14653dc4eb..4ef5fa8bc1d 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
+          <citerefentry><refentrytitle>systemd.time</refentrytitle>
+          <manvolnum>5</manvolnum></citerefentry>) 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;
     };
 
   };