NixOS/auto-upgrade: Add optional randomized delay

This commit is contained in:
Sean Buckley 2020-02-27 16:40:10 -05:00
parent b1ec189c9f
commit b6cad64ef6

@ -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;
};
}