infra/modules/nixos/common/auto-upgrade.nix

14 lines
496 B
Nix

{ lib, ... }:
{
system.autoUpgrade.enable = lib.mkDefault true;
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";
};
}