aboutsummaryrefslogtreecommitdiffstats
path: root/hosts/common/core/nix.nix
blob: a989f0387aee78de6e84f36b513b82d07f2ef106 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
{ inputs, lib, ... }: 

let
  build-tmp = "/var/tmp";
in {

  nix = {
    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";
      randomizedDelaySec = "14m";
      # Keep the last 2 generations
      options = "--delete-older-than 28d";
    };

  };

  systemd.services."nix-daemon".environment.TMPDIR = build-tmp;

}