From 8d22428192f649f01e709bb17a131bec081531fe Mon Sep 17 00:00:00 2001 From: RootHost-Stormwind Date: Fri, 25 Jul 2025 09:10:12 +0200 Subject: [PATCH] add unattended upgrades --- automatic-upgrades.nix | 17 +++++++++++++++++ master.nix | 1 + 2 files changed, 18 insertions(+) create mode 100644 automatic-upgrades.nix diff --git a/automatic-upgrades.nix b/automatic-upgrades.nix new file mode 100644 index 0000000..1a3be01 --- /dev/null +++ b/automatic-upgrades.nix @@ -0,0 +1,17 @@ +{ config, pkgs, ... }: + +{ + # Enable automatic garbage collection (prevents /boot or / filling up) + nix.gc.automatic = true; + nix.gc.dates = "03:00"; # run GC at 03:00 daily + + # Enable automatic system upgrades + system.autoUpgrade = { + enable = true; # turn on unattended upgrades + dates = "02:00"; # schedule upgrades at 02:00 each day + randomizedDelaySec = "45m"; # spread load by up to 45 minutes + allowReboot = false; # don't reboot if needed for new generation + }; + +} + diff --git a/master.nix b/master.nix index 42a7ac2..ba48972 100644 --- a/master.nix +++ b/master.nix @@ -11,6 +11,7 @@ in { imports = [ ./hardware-configuration.nix + ./automatic-upgrades.nix ./bootloader.nix ./networking.nix ./misc.nix