add unattended upgrades
This commit is contained in:
17
automatic-upgrades.nix
Normal file
17
automatic-upgrades.nix
Normal file
@@ -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
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -11,6 +11,7 @@ in
|
||||
{
|
||||
imports = [
|
||||
./hardware-configuration.nix
|
||||
./automatic-upgrades.nix
|
||||
./bootloader.nix
|
||||
./networking.nix
|
||||
./misc.nix
|
||||
|
||||
Reference in New Issue
Block a user