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://nix-community.cachix.org" 8 "https://install.determinate.systems" 9 ]; 10 trusted-public-keys = [ 11 "cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=" 12 "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=" 13 "cache.flakehub.com-3:hJuILl5sVK4iKm86JzgdXW12Y2Hwd5G07qKtHTOcDCM=" 14 ]; 15 cores = 0; 16 max-jobs = 2; 17 netrc-file = "/home/thehedgehog/.netrc"; 18 }; 19 description = "PyroNet machines and services"; 20 21 inputs = { 22 snowfall-lib = { 23 url = "github:snowfallorg/lib"; 24 inputs.nixpkgs.follows = "nixpkgs"; 25 inputs.flake-compat.follows = "flake-compat"; 26 }; 27 nixpkgs.url = "https://nixpkgs.dev/channel/nixpkgs-unstable"; 28 nixpkgs-stalwart-fix.url = "github:pyrox0/nixpkgs/fix/stalwart-module"; 29 stable.url = "github:nixos/nixpkgs/nixos-24.05"; 30 # Overrides 31 flake-compat.url = "github:edolstra/flake-compat"; 32 systems.url = "github:nix-systems/default"; 33 flake-parts = { 34 url = "github:hercules-ci/flake-parts"; 35 inputs.nixpkgs-lib.follows = "nixpkgs-lib"; 36 }; 37 flake-utils = { 38 url = "github:numtide/flake-utils"; 39 inputs.systems.follows = "systems"; 40 }; 41 nixpkgs-lib.url = "github:nix-community/nixpkgs.lib"; 42 43 # Inputs 44 agenix = { 45 url = "github:ryantm/agenix"; 46 inputs = { 47 nixpkgs.follows = "nixpkgs"; 48 systems.follows = "systems"; 49 home-manager.follows = "home-manager"; 50 }; 51 }; 52 buildbot-nix = { 53 url = "github:Mic92/buildbot-nix"; 54 inputs.nixpkgs.follows = "nixpkgs"; 55 inputs.flake-parts.follows = "flake-parts"; 56 }; 57 ctp = { 58 url = "github:catppuccin/nix"; 59 }; 60 deploy-rs = { 61 url = "github:serokell/deploy-rs"; 62 inputs = { 63 nixpkgs.follows = "nixpkgs"; 64 utils.follows = "flake-utils"; 65 flake-compat.follows = "flake-compat"; 66 }; 67 }; 68 dix = { 69 url = "https://flakehub.com/f/DeterminateSystems/nix-src/*"; 70 inputs = { 71 nixpkgs.follows = "nixpkgs"; 72 nixpkgs-regression.follows = ""; 73 nixpkgs-23-11.follows = ""; 74 75 flake-parts.follows = ""; 76 git-hooks-nix.follows = ""; 77 }; 78 }; 79 determinate = { 80 url = "github:DeterminateSystems/determinate"; 81 inputs = { 82 nixpkgs.follows = "nixpkgs"; 83 nix.follows = "dix"; 84 }; 85 }; 86 dns = { 87 url = "github:nix-community/dns.nix"; 88 inputs.flake-utils.follows = "flake-utils"; 89 inputs.nixpkgs.follows = "nixpkgs"; 90 }; 91 92 ghostty = { 93 url = "github:ghostty-org/ghostty"; 94 inputs.nixpkgs.follows = "nixpkgs"; 95 inputs.flake-utils.follows = "flake-utils"; 96 inputs.flake-compat.follows = "flake-compat"; 97 }; 98 golink = { 99 url = "github:tailscale/golink"; 100 inputs.systems.follows = "systems"; 101 inputs.nixpkgs.follows = "nixpkgs"; 102 }; 103 hardware = { 104 url = "github:nixos/nixos-hardware"; 105 }; 106 home-manager = { 107 url = "github:nix-community/home-manager"; 108 inputs.nixpkgs.follows = "nixpkgs"; 109 }; 110 iceshrimp = { 111 url = "git+https://iceshrimp.dev/pyrox/packaging"; 112 inputs.nixpkgs.follows = "nixpkgs"; 113 }; 114 mailserver = { 115 url = "gitlab:simple-nixos-mailserver/nixos-mailserver/master"; 116 inputs = { 117 flake-compat.follows = "flake-compat"; 118 nixpkgs.follows = "nixpkgs"; 119 }; 120 }; 121 nix-search = { 122 url = "github:diamondburned/nix-search"; 123 inputs.nixpkgs.follows = "nixpkgs"; 124 inputs.flake-utils.follows = "flake-utils"; 125 inputs.flake-compat.follows = "flake-compat"; 126 }; 127 nix-index = { 128 url = "github:nix-community/nix-index"; 129 inputs.flake-compat.follows = "flake-compat"; 130 inputs.nixpkgs.follows = "nixpkgs"; 131 }; 132 nix-index-database = { 133 url = "github:Mic92/nix-index-database"; 134 inputs.nixpkgs.follows = "nixpkgs"; 135 }; 136 my-pkgs = { 137 url = "git+https://git.pyrox.dev/pyrox/pkgs"; 138 inputs.nixpkgs.follows = "nixpkgs"; 139 }; 140 tangled-sh = { 141 url = "git+https://tangled.sh/@tangled.sh/core"; 142 }; 143 }; 144 145 outputs = 146 inputs@{ self, ... }: 147 let 148 lib = inputs.snowfall-lib.mkLib { 149 inherit inputs; 150 src = ./.; 151 snowfall = { 152 meta = { 153 name = "pyronet"; 154 title = "PyroNet Config"; 155 }; 156 namespace = "py"; 157 }; 158 }; 159 overlays = [ 160 self.overlays.pyronet-packages 161 self.overlays.nix-index 162 self.overlays.openssh-fixperms 163 inputs.golink.overlays.default 164 ]; 165 in 166 lib.mkFlake { 167 # Nixpkgs configuration 168 channels-config = { 169 allowUnfree = true; 170 }; 171 172 # Overlays for Nixpkgs. 173 inherit overlays; 174 175 # Home-manager configurations 176 homes = { 177 # Default modules for all homes 178 modules = with inputs; [ 179 nix-index-database.homeModules.nix-index 180 ctp.homeModules.catppuccin 181 ]; 182 }; 183 184 # NixOS Configurations 185 systems = { 186 # Modules for all systems 187 modules.nixos = with inputs; [ 188 agenix.nixosModules.default 189 buildbot-nix.nixosModules.buildbot-worker 190 ctp.nixosModules.catppuccin 191 determinate.nixosModules.default 192 ]; 193 hosts = { 194 # Zaphod, my personal Framework 16 laptop 195 zaphod.modules = with inputs; [ hardware.nixosModules.framework-16-7040-amd ]; 196 197 # Prefect, my main VPS 198 prefect.modules = with inputs; [ mailserver.nixosModule ]; 199 200 # Marvin, my main homelab machine 201 marvin.modules = with inputs; [ 202 buildbot-nix.nixosModules.buildbot-master 203 golink.nixosModules.default 204 iceshrimp.nixosModules.default 205 tangled-sh.nixosModules.knot 206 tangled-sh.nixosModules.spindle 207 ]; 208 }; 209 }; 210 templates = { 211 uv.description = "Python template flake that uses uv"; 212 }; 213 214 outputs-builder = channels: { 215 # Define default packages to use everywhere 216 packages = { 217 nvim = channels.nixpkgs.neovim-unwrapped; 218 }; 219 formatter = channels.nixpkgs.nixfmt-rfc-style; 220 221 }; 222 deploy = lib.mkDeploy { inherit (inputs) self; }; 223 }; 224}