diff options
author | Sean Buckley <sean.bck@gmail.com> | 2020-02-27 16:40:10 -0500 |
---|---|---|
committer | Sean Buckley <sean.bck@gmail.com> | 2020-02-27 16:40:10 -0500 |
commit | b6cad64ef6cbbfe48b920bfab51a41eeefe8b636 (patch) | |
tree | 506379e073395ccdd11c8fb4a3068722ea17cb2b | |
parent | b1ec189c9faa017e7a8dc3aa3b8243da3d61b8c7 (diff) |
NixOS/auto-upgrade: Add optional randomized delay
-rw-r--r-- | nixos/modules/tasks/auto-upgrade.nix | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/nixos/modules/tasks/auto-upgrade.nix b/nixos/modules/tasks/auto-upgrade.nix index 7fe066991918..57ca7cd94194 100644 --- a/nixos/modules/tasks/auto-upgrade.nix +++ b/nixos/modules/tasks/auto-upgrade.nix @@ -63,6 +63,17 @@ let cfg = config.system.autoUpgrade; in ''; }; + randomizedDelaySec = mkOption { + default = "0"; + type = types.str; + example = "45min"; + description = '' + Add a randomized delay to wait before automatically upgrading. + The delay will be between zero and this value. + This value must be a valid systemd timestamp. + ''; + }; + }; }; @@ -109,6 +120,8 @@ let cfg = config.system.autoUpgrade; in startAt = cfg.dates; }; + systemd.timers.nixos-upgrade.timerConfig.RandomizedDelaySec = cfg.randomizedDelaySec; + }; } |