Nix configurations for my personal machines (Linux & macOS)
1{
2 delib,
3 inputs,
4 ...
5}: let
6 shared = {
7 nixpkgs.config = import ../files/nixpkgs-config.nix;
8
9 nix.settings = {
10 auto-optimise-store = true;
11 experimental-features = ["nix-command" "flakes"];
12 trusted-users = ["root" "@wheel" "ovy"];
13 };
14 };
15in
16 delib.module {
17 name = "nix";
18
19 # TODO: double check home-manager options
20 home.always =
21 shared
22 // {
23 xdg.configFile."nixpkgs/config.nix".source = ../files/nixpkgs-config.nix;
24 };
25
26 nixos.always =
27 shared
28 // {
29 nix = {
30 gc = {
31 automatic = true;
32 options = "--delete-older-than 10d";
33 dates = "weekly";
34 };
35
36 nixPath = ["nixpkgs=${inputs.nixpkgs}"];
37
38 registry.nixpkgs.to = {
39 type = "path";
40 path = inputs.nixpkgs;
41 narHash = inputs.nixpkgs.narHash;
42 };
43
44 settings = {
45 auto-optimise-store = true;
46 experimental-features = ["nix-command" "flakes"];
47 trusted-users = ["root" "@wheel" "ovy"];
48 };
49 };
50
51 system.tools.nixos-option.enable = false;
52 };
53
54 darwin.always = {
55 nix = {
56 buildMachines = [
57 {
58 hostName = "rushing.axolotl-map.ts.net";
59 sshUser = "colmena-deploy";
60 system = "x86_64-linux";
61 speedFactor = 2;
62 maxJobs = 6;
63 protocol = "ssh-ng";
64 }
65 {
66 hostName = "skyline.axolotl-map.ts.net";
67 sshUser = "colmena-deploy";
68 system = "aarch64-linux";
69 speedFactor = 1;
70 maxJobs = 2;
71 protocol = "ssh-ng";
72 }
73 ];
74
75 distributedBuilds = true;
76
77 gc = {
78 automatic = true;
79 options = "--delete-older-than 7d";
80 interval.Weekday = 6;
81 };
82
83 optimise.automatic = true;
84
85 settings = {
86 builders-use-substitutes = true;
87 experimental-features = "nix-command flakes";
88 trusted-users = ["root" "ovy"];
89 };
90 };
91 };
92 }