diff options
Diffstat (limited to 'hosts/common/core/nix.nix')
| -rw-r--r-- | hosts/common/core/nix.nix | 30 |
1 files changed, 12 insertions, 18 deletions
diff --git a/hosts/common/core/nix.nix b/hosts/common/core/nix.nix index 14252d8..3aac7fc 100644 --- a/hosts/common/core/nix.nix +++ b/hosts/common/core/nix.nix @@ -1,29 +1,23 @@ { inputs, lib, ... }: - -let - build-tmp = "/var/tmp"; -in { - +{ nix = { + gc = { + automatic = true; + dates = "daily"; + options = "--delete-older-than 7d"; + randomizedDelaySec = "5min"; + }; settings = { auto-optimise-store = lib.mkDefault true; - build-dir = build-tmp; experimental-features = [ "nix-command" "flakes" ]; trusted-users = [ "root" "@wheel" ]; warn-dirty = false; }; - - # Garbage Collection - gc = { - automatic = true; - dates = "weekly"; - options = "--delete-older-than 30d"; - persistent = true; - randomizedDelaySec = "14m"; - }; - }; - systemd.services."nix-daemon".environment.TMPDIR = build-tmp; - + 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"; + }; } |
