1
0

modules/nixfiles: Specify dedicated system update times per host

This commit is contained in:
clerie 2023-12-15 18:58:01 +01:00
parent 97cb51e4fb
commit d05f74ece9
3 changed files with 9 additions and 2 deletions

View File

@ -186,6 +186,7 @@
clerie.nixfiles.system-auto-upgrade = { clerie.nixfiles.system-auto-upgrade = {
enable = true; enable = true;
allowReboot = true; allowReboot = true;
startAt = "*-*-* 06:22:00";
}; };
clerie.monitoring = { clerie.monitoring = {

View File

@ -186,6 +186,7 @@
clerie.nixfiles.system-auto-upgrade = { clerie.nixfiles.system-auto-upgrade = {
enable = true; enable = true;
allowReboot = true; allowReboot = true;
startAt = "*-*-* 07:22:00";
}; };
clerie.monitoring = { clerie.monitoring = {

View File

@ -15,6 +15,11 @@ in
default = false; default = false;
description = "Monitor NixOS"; description = "Monitor NixOS";
}; };
startAt = mkOption {
type = with types; nullOr string;
default = null;
description = "Systemd time string for starting the unit";
};
}; };
}; };
config = mkIf cfg.enable { config = mkIf cfg.enable {
@ -31,8 +36,8 @@ in
systemd.timers.nixfiles-system-auto-upgrade = { systemd.timers.nixfiles-system-auto-upgrade = {
wantedBy = [ "timers.target" ]; wantedBy = [ "timers.target" ];
timerConfig = { timerConfig = {
OnCalendar = "*-*-* 05:37:00"; OnCalendar = if cfg.startAt == null then "*-*-* 05:37:00" else cfg.startAt;
RandomizedDelaySec = "2h"; RandomizedDelaySec = if cfg.startAt == null then "2h" else "10m";
}; };
after = [ "network-online.target" ]; after = [ "network-online.target" ];
}; };