{ 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 nix.gc.options = "--delete-older-than 30d"; # drop generations older than 30 days nix.optimise.automatic = true; # hard-link identical store files # This host has no configuration.nix: point at master.nix, # otherwise nixos-upgrade.service (and plain nixos-rebuild) cannot find the config. nix.nixPath = [ "nixpkgs=/nix/var/nix/profiles/per-user/root/channels/nixos" "nixos-config=/etc/nixos/master.nix" "/nix/var/nix/profiles/per-user/root/channels" ]; # 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 }; }