Files
AZ-NIX-CLIENTS/roles/thin-client/deployment/auto-upgrade.nix
T

37 lines
904 B
Nix

# roles/thin-client/deployment/auto-upgrade.nix
#
# Q18 decision: Auto-Upgrade pro Host daily, Generation-Picker + BTRFS-
# Snapshot für Rollback, Auto-Reboot nach Kernel-Update.
{
config,
lib,
...
}: let
inherit (lib) mkIf;
cfg = config.az.tc;
in {
config = mkIf cfg.enable {
system.autoUpgrade = {
enable = true;
dates = "03:00";
randomizedDelaySec = "30min";
flake = "git+https://code.m3ta.dev/m3tam3re/AZ-NIX-CLIENTS";
flags = [
"--no-write-lock-file"
];
allowReboot = true;
rebootWindow = {
lower = "03:00";
upper = "05:00";
};
};
# Always keep at least 7 generations for rollback
boot.loader.systemd-boot.configurationLimit = 10;
# gc — keep more generations than the autoUpgrade default to allow
# rollback over a weekend.
nix.gc.options = "--delete-older-than 14d";
};
}