retry nixos upgrade on failure

This commit is contained in:
Jörg Thalheim 2023-08-05 08:01:56 +02:00 committed by zowoq
parent 2473af9be8
commit 977424e2d7

View file

@ -3,4 +3,11 @@
system.autoUpgrade.flake = "github:nix-community/infra";
system.autoUpgrade.dates = "hourly";
system.autoUpgrade.flags = [ "--option" "accept-flake-config" "true" "--option" "tarball-ttl" "0" ];
# Restart the upgrade service if it fails twice in 5 seconds.
systemd.services.nixos-upgrade = {
unitConfig.StartLimitBurst = 2;
unitConfig.StartLimitIntervalSec = 5;
serviceConfig.Restart = "on-failure";
};
}