/ darwinModules / nix-daemon.nix
nix-daemon.nix
 1  { self, pkgs, ... }:
 2  {
 3    nixpkgs.overlays = [ self.overlays.default ];
 4  
 5    # this extends srvos's common settings
 6    nix = {
 7      package = pkgs.nixVersions.latest;
 8  
 9      gc.automatic = true;
10      gc.interval = {
11        Hour = 3;
12        Minute = 15;
13      };
14      gc.options = "--delete-older-than 10d";
15  
16      settings = {
17        # for nix-direnv
18        keep-outputs = true;
19        keep-derivations = true;
20  
21        substituters = [
22          "https://cache.nixos.org"
23          "https://nix-community.cachix.org"
24          "https://cache.mulatta.io"
25        ];
26        trusted-substituters = [
27          "https://cache.nixos.org"
28          "https://nix-community.cachix.org"
29          "https://cache.mulatta.io"
30        ];
31        trusted-public-keys = [
32          "cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY="
33          "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
34          "cache.mulatta.io-1:DrV+Oy2azNyVKM7ihhD1QoOetRUnW+1G6RWToUpSO4U="
35        ];
36  
37        trusted-users = [
38          "seungwon"
39          "root"
40        ];
41  
42        fallback = true;
43        warn-dirty = false;
44      };
45    };
46  
47    launchd.daemons.nix-daemon = {
48      serviceConfig.Nice = -10;
49    };
50  }