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 golink = { 93 url = "github:tailscale/golink"; 94 inputs.systems.follows = "systems"; 95 inputs.nixpkgs.follows = "nixpkgs"; 96 }; 97 hardware = { 98 url = "github:nixos/nixos-hardware"; 99 }; 100 home-manager = { 101 url = "github:nix-community/home-manager"; 102 inputs.nixpkgs.follows = "nixpkgs"; 103 }; 104 iceshrimp = { 105 url = "git+https://iceshrimp.dev/pyrox/packaging"; 106 inputs.nixpkgs.follows = "nixpkgs"; 107 }; 108 mailserver = { 109 url = "gitlab:simple-nixos-mailserver/nixos-mailserver/master"; 110 inputs = { 111 flake-compat.follows = "flake-compat"; 112 nixpkgs.follows = "nixpkgs"; 113 }; 114 }; 115 nix-search = { 116 url = "github:diamondburned/nix-search"; 117 inputs.nixpkgs.follows = "nixpkgs"; 118 inputs.flake-utils.follows = "flake-utils"; 119 inputs.flake-compat.follows = "flake-compat"; 120 }; 121 nix-index = { 122 url = "github:nix-community/nix-index"; 123 inputs.flake-compat.follows = "flake-compat"; 124 inputs.nixpkgs.follows = "nixpkgs"; 125 }; 126 nix-index-database = { 127 url = "github:Mic92/nix-index-database"; 128 inputs.nixpkgs.follows = "nixpkgs"; 129 }; 130 my-pkgs = { 131 url = "git+https://git.pyrox.dev/pyrox/pkgs"; 132 inputs.nixpkgs.follows = "nixpkgs"; 133 }; 134 tangled-sh = { 135 url = "git+https://tangled.sh/@tangled.sh/core"; 136 }; 137 }; 138 139 outputs = 140 inputs@{ self, ... }: 141 let 142 lib = inputs.snowfall-lib.mkLib { 143 inherit inputs; 144 src = ./.; 145 snowfall = { 146 meta = { 147 name = "pyronet"; 148 title = "PyroNet Config"; 149 }; 150 namespace = "py"; 151 }; 152 }; 153 overlays = [ 154 self.overlays.pyronet-packages 155 self.overlays.nix-index 156 self.overlays.openssh-fixperms 157 inputs.golink.overlays.default 158 ]; 159 in 160 lib.mkFlake { 161 # Nixpkgs configuration 162 channels-config = { 163 allowUnfree = true; 164 }; 165 166 # Overlays for Nixpkgs. 167 inherit overlays; 168 169 # Home-manager configurations 170 homes = { 171 # Default modules for all homes 172 modules = with inputs; [ 173 nix-index-database.homeModules.nix-index 174 ctp.homeModules.catppuccin 175 ]; 176 }; 177 178 # NixOS Configurations 179 systems = { 180 # Modules for all systems 181 modules.nixos = with inputs; [ 182 agenix.nixosModules.default 183 buildbot-nix.nixosModules.buildbot-worker 184 ctp.nixosModules.catppuccin 185 determinate.nixosModules.default 186 ]; 187 hosts = { 188 # Zaphod, my personal Framework 16 laptop 189 zaphod.modules = with inputs; [ hardware.nixosModules.framework-16-7040-amd ]; 190 191 # Prefect, my main VPS 192 prefect.modules = with inputs; [ mailserver.nixosModule ]; 193 194 # Marvin, my main homelab machine 195 marvin.modules = with inputs; [ 196 buildbot-nix.nixosModules.buildbot-master 197 golink.nixosModules.default 198 iceshrimp.nixosModules.default 199 tangled-sh.nixosModules.knot 200 tangled-sh.nixosModules.spindle 201 ]; 202 }; 203 }; 204 templates = { 205 uv.description = "Python template flake that uses uv"; 206 }; 207 208 outputs-builder = channels: { 209 # Define default packages to use everywhere 210 packages = { 211 nvim = channels.nixpkgs.neovim-unwrapped; 212 }; 213 formatter = channels.nixpkgs.nixfmt-rfc-style; 214 215 }; 216 deploy = lib.mkDeploy { inherit (inputs) self; }; 217 }; 218}