1
0

Compare commits

...

5 Commits

2 changed files with 15 additions and 4 deletions

View File

@ -186,11 +186,11 @@
}, },
"nixos-hardware": { "nixos-hardware": {
"locked": { "locked": {
"lastModified": 1701250978, "lastModified": 1701598471,
"narHash": "sha256-ohu3cz4edjpGxs2qUTgbs0WrnewOX4crnUJNEB6Jox4=", "narHash": "sha256-kHdJ2qc4qKeMTzUIHEcP41ah/dBIhCgvWgrjllt2G78=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixos-hardware", "repo": "nixos-hardware",
"rev": "8772491ed75f150f02552c60694e1beff9f46013", "rev": "a89745edd5f657e2e5be5ed1bea86725ca78d92e",
"type": "github" "type": "github"
}, },
"original": { "original": {

View File

@ -19,11 +19,22 @@ in
}; };
config = mkIf cfg.enable { config = mkIf cfg.enable {
systemd.services.nixfiles-system-auto-upgrade = { systemd.services.nixfiles-system-auto-upgrade = {
# Make sure this unit does not stop themself while upgrading
restartIfChanged = false;
unitConfig.X-StopOnRemoval = false;
serviceConfig = { serviceConfig = {
Type = "oneshot"; Type = "oneshot";
ExecStart = pkgs.nixfiles-system-upgrade + "/bin/nixfiles-system-upgrade --no-confirm${optionalString cfg.allowReboot " --allow-reboot"}"; ExecStart = pkgs.nixfiles-system-upgrade + "/bin/nixfiles-system-upgrade --no-confirm${optionalString cfg.allowReboot " --allow-reboot"}";
}; };
startAt = "*-*-* 06:47:00"; };
systemd.timers.nixfiles-system-auto-upgrade = {
wantedBy = [ "timers.target" ];
timerConfig = {
OnCalendar = "*-*-* 05:37:00";
RandomizedDelaySec = "2h";
};
after = [ "network-online.target" ];
}; };
}; };
} }