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 = {
enable = true;
allowReboot = true;
startAt = "*-*-* 06:22:00";
};
clerie.monitoring = {

View File

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

View File

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