From 494131ece5788e81fba78addba47b5dada10e008 Mon Sep 17 00:00:00 2001 From: DashieTM Date: Mon, 5 Aug 2024 00:03:25 +0200 Subject: [PATCH] Add deletion policy for older nix generations --- base/common_hardware.nix | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/base/common_hardware.nix b/base/common_hardware.nix index 7eb5054..a739a1c 100644 --- a/base/common_hardware.nix +++ b/base/common_hardware.nix @@ -7,7 +7,10 @@ in (modulesPath + "/installer/scan/not-detected.nix") ]; # Bootloader. - boot.loader.systemd-boot.enable = true; + boot.loader.systemd-boot = { + enable = true; + configurationLimit = 5; + }; boot.loader.efi.canTouchEfiVariables = true; # Enable networking @@ -28,7 +31,15 @@ in nixpkgs.hostPlatform = lib.mkDefault config.conf.system; nix = { + gc = { + automatic = true; + dates = "weekly"; + options = "--delete-older-than 7d --delete-generations +5"; + }; settings = { + trusted-users = [ + username + ]; auto-optimise-store = true; experimental-features = "nix-command flakes"; @@ -53,10 +64,6 @@ in DIRENV_LOG_FORMAT = ""; }; - nix.settings.trusted-users = [ - username - ]; - boot.kernelPackages = config.conf.kernel; boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" ]; boot.kernelParams = [