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