My Nix Configuration
1{ 2 nixConfig = { 3 experimental-features = "nix-command flakes"; 4 substitute = "true"; 5 extra-substituters = [ 6 "https://cache.nixos.org" 7 "https://crane.cachix.org" 8 "https://isabelroses.cachix.org" 9 "https://nix-community.cachix.org" 10 "https://nixpkgs-wayland.cachix.org" 11 "https://viperml.cachix.org" 12 ]; 13 trusted-public-keys = [ 14 "cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=" 15 "crane.cachix.org-1:8Scfpmn9w+hGdXH/Q9tTLiYAE/2dnJYRJP7kl80GuRk=" 16 "isabelroses.cachix.org-1:mXdV/CMcPDaiTmkQ7/4+MzChpOe6Cb97njKmBQQmLPM=" 17 "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=" 18 "nixpkgs-wayland.cachix.org-1:3lwxaILxMRkVhehr5StQprHdEo4IrE8sRho9R9HOLYA=" 19 "viperml.cachix.org-1:qZhKBMTfmcLL+OG6fj/hzsMEedgKvZVFRRAhq7j8Vh8=" 20 ]; 21 cores = 0; 22 max-jobs = 2; 23 netrc-file = "/home/thehedgehog/.netrc"; 24 }; 25 description = "PyroNet machines and services"; 26 27 inputs = { 28 snowfall-lib = { 29 url = "github:snowfallorg/lib"; 30 inputs.nixpkgs.follows = "nixpkgs"; 31 inputs.flake-compat.follows = "flake-compat"; 32 }; 33 nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable"; 34 stable.url = "github:nixos/nixpkgs/nixos-24.05"; 35 # Overrides 36 flake-compat.url = "github:edolstra/flake-compat"; 37 systems.url = "github:nix-systems/default"; 38 flake-parts = { 39 url = "github:hercules-ci/flake-parts"; 40 inputs.nixpkgs-lib.follows = "nixpkgs-lib"; 41 }; 42 flake-utils = { 43 url = "github:numtide/flake-utils"; 44 inputs.systems.follows = "systems"; 45 }; 46 nixpkgs-lib.url = "github:nix-community/nixpkgs.lib"; 47 48 # Inputs 49 agenix = { 50 url = "github:ryantm/agenix"; 51 inputs = { 52 nixpkgs.follows = "nixpkgs"; 53 systems.follows = "systems"; 54 home-manager.follows = "home-manager"; 55 }; 56 }; 57 authentik = { 58 url = "github:nix-community/authentik-nix"; 59 inputs = { 60 flake-utils.follows = "flake-utils"; 61 flake-parts.follows = "flake-parts"; 62 flake-compat.follows = "flake-compat"; 63 nixpkgs.follows = "nixpkgs"; 64 }; 65 }; 66 buildbot-nix = { 67 url = "github:Mic92/buildbot-nix"; 68 inputs.nixpkgs.follows = "nixpkgs"; 69 inputs.flake-parts.follows = "flake-parts"; 70 }; 71 ctp = { 72 url = "github:catppuccin/nix"; 73 }; 74 deploy-rs = { 75 url = "github:serokell/deploy-rs"; 76 inputs = { 77 nixpkgs.follows = "nixpkgs"; 78 utils.follows = "flake-utils"; 79 flake-compat.follows = "flake-compat"; 80 }; 81 }; 82 dns = { 83 url = "github:nix-community/dns.nix"; 84 inputs.flake-utils.follows = "flake-utils"; 85 inputs.nixpkgs.follows = "nixpkgs"; 86 }; 87 golink = { 88 url = "github:tailscale/golink"; 89 inputs.parts.follows = "flake-parts"; 90 inputs.systems.follows = "systems"; 91 inputs.nixpkgs.follows = "nixpkgs"; 92 }; 93 hardware = { 94 url = "github:nixos/nixos-hardware"; 95 }; 96 home-manager = { 97 url = "github:nix-community/home-manager"; 98 inputs.nixpkgs.follows = "nixpkgs"; 99 }; 100 iceshrimp = { 101 url = "git+https://iceshrimp.dev/pyrox/packaging"; 102 inputs.nixpkgs.follows = "nixpkgs"; 103 }; 104 mailserver = { 105 url = "gitlab:simple-nixos-mailserver/nixos-mailserver/master"; 106 inputs = { 107 flake-compat.follows = "flake-compat"; 108 nixpkgs.follows = "nixpkgs"; 109 }; 110 }; 111 nix-search = { 112 url = "github:diamondburned/nix-search"; 113 inputs.nixpkgs.follows = "nixpkgs"; 114 inputs.flake-utils.follows = "flake-utils"; 115 inputs.flake-compat.follows = "flake-compat"; 116 }; 117 nh = { 118 url = "github:viperML/nh"; 119 inputs.nixpkgs.follows = "nixpkgs"; 120 }; 121 nixd = { 122 url = "github:nix-community/nixd"; 123 inputs.nixpkgs.follows = "nixpkgs"; 124 inputs.flake-parts.follows = "flake-parts"; 125 }; 126 nix-index = { 127 url = "github:nix-community/nix-index"; 128 inputs.flake-compat.follows = "flake-compat"; 129 inputs.nixpkgs.follows = "nixpkgs"; 130 }; 131 nix-index-database = { 132 url = "github:Mic92/nix-index-database"; 133 inputs.nixpkgs.follows = "nixpkgs"; 134 }; 135 my-pkgs = { 136 url = "git+https://git.pyrox.dev/pyrox/pkgs"; 137 inputs.nixpkgs.follows = "nixpkgs"; 138 }; 139 topology = { 140 url = "github:oddlama/nix-topology"; 141 inputs.nixpkgs.follows = "nixpkgs"; 142 inputs.flake-utils.follows = "flake-utils"; 143 }; 144 }; 145 146 outputs = 147 inputs@{ self, ... }: 148 let 149 lib = inputs.snowfall-lib.mkLib { 150 inherit inputs; 151 src = ./.; 152 snowfall = { 153 meta = { 154 name = "pyronet"; 155 title = "PyroNet Config"; 156 }; 157 namespace = "py"; 158 }; 159 }; 160 overlays = [ 161 self.overlays.pyronet-packages 162 self.overlays.nix-index 163 self.overlays.bluez-wiimote 164 self.overlays.sway-unwrapped 165 inputs.my-pkgs.overlays.cinny 166 inputs.golink.overlays.default 167 inputs.nixd.overlays.default 168 inputs.topology.overlays.default 169 ]; 170 in 171 lib.mkFlake { 172 # Nixpkgs configuration 173 channels-config = { 174 allowUnfree = true; 175 }; 176 177 # Overlays for Nixpkgs. 178 inherit overlays; 179 180 # Home-manager configurations 181 homes = { 182 # Default modules for all homes 183 modules = with inputs; [ 184 nix-index-database.hmModules.nix-index 185 ctp.homeManagerModules.catppuccin 186 ]; 187 }; 188 189 # NixOS Configurations 190 systems = { 191 # Modules for all systems 192 modules.nixos = with inputs; [ 193 agenix.nixosModules.default 194 buildbot-nix.nixosModules.buildbot-worker 195 ctp.nixosModules.catppuccin 196 topology.nixosModules.default 197 ]; 198 hosts = { 199 # Zaphod, my personal Framework 16 laptop 200 zaphod.modules = with inputs; [ hardware.nixosModules.framework-16-7040-amd ]; 201 202 # Prefect, my main VPS 203 prefect.modules = with inputs; [ mailserver.nixosModule ]; 204 205 # Marvin, my main homelab machine 206 marvin.modules = with inputs; [ 207 authentik.nixosModules.default 208 buildbot-nix.nixosModules.buildbot-master 209 golink.nixosModules.default 210 iceshrimp.nixosModules.default 211 ]; 212 }; 213 }; 214 templates = { 215 uv.description = "Python template flake that uses uv"; 216 }; 217 218 outputs-builder = channels: { 219 # Define default packages to use everywhere 220 packages = { 221 nvim = channels.nixpkgs.neovim-unwrapped; 222 customGit = channels.nixpkgs.git.override { 223 withLibsecret = true; 224 withSsh = true; 225 perlSupport = false; 226 osxkeychainSupport = false; 227 guiSupport = false; 228 svnSupport = false; 229 }; 230 }; 231 formatter = channels.nixpkgs.nixfmt-rfc-style; 232 233 }; 234 deploy = lib.mkDeploy { inherit (inputs) self; }; 235 topology = import inputs.topology { 236 pkgs = import inputs.nixpkgs { 237 inherit overlays; 238 system = "x86_64-linux"; 239 }; 240 modules = [ 241 ./topology.nix 242 { nixosConfigurations = self.nixosConfigurations; } 243 ]; 244 }; 245 246 }; 247}