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 nixos.always = 26 shared 27 // { 28 nix = { 29 gc = { 30 automatic = true; 31 options = "--delete-older-than 10d"; 32 dates = "weekly"; 33 }; 34 35 nixPath = ["nixpkgs=${inputs.nixpkgs}"]; 36 37 registry.nixpkgs.to = { 38 type = "path"; 39 path = inputs.nixpkgs; 40 narHash = inputs.nixpkgs.narHash; 41 }; 42 }; 43 44 system.tools.nixos-option.enable = false; 45 }; 46 47 darwin.always = { 48 nix = { 49 buildMachines = [ 50 { 51 hostName = "rushing.axolotl-map.ts.net"; 52 sshUser = "colmena-deploy"; 53 system = "x86_64-linux"; 54 speedFactor = 2; 55 maxJobs = 6; 56 protocol = "ssh-ng"; 57 } 58 { 59 hostName = "skyline.axolotl-map.ts.net"; 60 sshUser = "colmena-deploy"; 61 system = "aarch64-linux"; 62 speedFactor = 1; 63 maxJobs = 2; 64 protocol = "ssh-ng"; 65 } 66 ]; 67 68 distributedBuilds = true; 69 70 gc = { 71 automatic = true; 72 options = "--delete-older-than 7d"; 73 interval.Weekday = 6; 74 }; 75 76 optimise.automatic = true; 77 78 settings = { 79 builders-use-substitutes = true; 80 experimental-features = "nix-command flakes"; 81 trusted-users = ["root" "ovy"]; 82 }; 83 }; 84 }; 85 }