diff options
Diffstat (limited to 'hosts/common/core/nix.nix')
-rw-r--r-- | hosts/common/core/nix.nix | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/hosts/common/core/nix.nix b/hosts/common/core/nix.nix index a989f03..c6279dc 100644 --- a/hosts/common/core/nix.nix +++ b/hosts/common/core/nix.nix @@ -17,13 +17,20 @@ in { gc = { automatic = true; dates = "weekly"; + options = "--delete-older-than 30d"; + persistent = true; randomizedDelaySec = "14m"; - # Keep the last 2 generations - options = "--delete-older-than 28d"; }; }; - systemd.services."nix-daemon".environment.TMPDIR = build-tmp; + systemd = { + services."nix-daemon".environment.TMPDIR = build-tmp; + user.services."nix-gc" = { + description = "Garbage collection for user profiles"; + script = "/run/current-system/sw/bin/nix-collect-garbage --delete-older-than 30d"; + startAt = "daily"; + }; + }; } |