nixos/auto-upgrade: add system.autoUpgrade.fixedRandomDelay
From systemd 247, timers can be configured to randomize their delay once and to apply the same random delay for all future executions. This allows users to have less jitter between auto-upgrade executions while still avoiding multiple timers firing simultaneously on a machine or multiple machines all performing their upgrades simultaneously. The default option value (false) is backwards compatible. All supported versions of NixOS (in fact, back to and including 21.05) use systemd 247 or later.
This commit is contained in:
parent
28330aa204
commit
d077cd8691
1 changed files with 12 additions and 0 deletions
|
@ -109,6 +109,17 @@ in {
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
fixedRandomDelay = mkOption {
|
||||||
|
default = false;
|
||||||
|
type = types.bool;
|
||||||
|
example = true;
|
||||||
|
description = lib.mdDoc ''
|
||||||
|
Make the randomized delay consistent between runs.
|
||||||
|
This reduces the jitter between automatic upgrades.
|
||||||
|
See {option}`randomizedDelaySec` for configuring the randomized delay.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
rebootWindow = mkOption {
|
rebootWindow = mkOption {
|
||||||
description = lib.mdDoc ''
|
description = lib.mdDoc ''
|
||||||
Define a lower and upper time value (in HH:MM format) which
|
Define a lower and upper time value (in HH:MM format) which
|
||||||
|
@ -253,6 +264,7 @@ in {
|
||||||
systemd.timers.nixos-upgrade = {
|
systemd.timers.nixos-upgrade = {
|
||||||
timerConfig = {
|
timerConfig = {
|
||||||
RandomizedDelaySec = cfg.randomizedDelaySec;
|
RandomizedDelaySec = cfg.randomizedDelaySec;
|
||||||
|
FixedRandomDelay = cfg.fixedRandomDelay;
|
||||||
Persistent = cfg.persistent;
|
Persistent = cfg.persistent;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue