From 32f04d5e4781eff7f6a6b5bdb102bb868ac49088 Mon Sep 17 00:00:00 2001 From: wi11-holdsworth <83637728+wi11-holdsworth@users.noreply.github.com> Date: Wed, 3 Sep 2025 17:26:02 +1000 Subject: [PATCH] add automatic nix store garbage collection --- modules/nixos/features/nix-settings.nix | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/modules/nixos/features/nix-settings.nix b/modules/nixos/features/nix-settings.nix index 17c6c71..9fcaf07 100644 --- a/modules/nixos/features/nix-settings.nix +++ b/modules/nixos/features/nix-settings.nix @@ -5,7 +5,16 @@ in { config = lib.mkIf config.${feature}.enable { nix = { - optimise.automatic = true; + gc = { + automatic = true; + dates = "weekly"; + options = "--delete-older-than 20d"; + persistent = true; + }; + optimise = { + automatic = true; + persistent = true; + }; settings = { experimental-features = [ "nix-command"