diff options
Diffstat (limited to 'hosts/common')
| -rw-r--r-- | hosts/common/core/nix.nix | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/hosts/common/core/nix.nix b/hosts/common/core/nix.nix index 3c798ae..3aac7fc 100644 --- a/hosts/common/core/nix.nix +++ b/hosts/common/core/nix.nix @@ -1,6 +1,12 @@ { inputs, lib, ... }: { nix = { + gc = { + automatic = true; + dates = "daily"; + options = "--delete-older-than 7d"; + randomizedDelaySec = "5min"; + }; settings = { auto-optimise-store = lib.mkDefault true; experimental-features = [ "nix-command" "flakes" ]; @@ -8,4 +14,10 @@ warn-dirty = false; }; }; + + systemd.user.services."nix-gc" = { + description = "Garbage collection for user profiles"; + script = "/run/current-system/sw/bin/nix-collect-garbage --delete-older-than 7d"; + startAt = "daily"; + }; } |
