Kieran's opinionated (and probably slightly dumb) nix config
1{ 2 description = "Kieran's opinionated (and probably slightly dumb) nix config"; 3 4 inputs = { 5 # Nixpkgs 6 nixpkgs.url = "github:nixos/nixpkgs/nixos-25.05"; 7 nixpkgs-unstable.url = "github:nixos/nixpkgs/nixos-unstable"; 8 9 # NixOS hardware configuration 10 hardware.url = "github:NixOS/nixos-hardware/master"; 11 12 # Home manager 13 home-manager.url = "github:nix-community/home-manager/release-25.05"; 14 home-manager.inputs.nixpkgs.follows = "nixpkgs"; 15 16 # Nix-Darwin 17 nix-darwin.url = "github:nix-darwin/nix-darwin/nix-darwin-25.05"; 18 nix-darwin.inputs.nixpkgs.follows = "nixpkgs"; 19 20 disko.url = "github:nix-community/disko"; 21 disko.inputs.nixpkgs.follows = "nixpkgs"; 22 23 nixos-facter-modules.url = "github:numtide/nixos-facter-modules"; 24 25 # agenix 26 agenix.url = "github:ryantm/agenix"; 27 28 spicetify-nix = { 29 url = "github:Gerg-L/spicetify-nix"; 30 inputs.nixpkgs.follows = "nixpkgs"; 31 }; 32 33 catppuccin = { 34 url = "github:catppuccin/nix?rev=f518f96a60aceda4cd487437b25eaa48d0f1b97d"; 35 inputs.nixpkgs.follows = "nixpkgs"; 36 }; 37 38 catppuccin-vsc = { 39 url = "github:catppuccin/vscode"; 40 }; 41 42 nix-vscode-extensions.url = "github:nix-community/nix-vscode-extensions"; 43 44 frc-nix = { 45 url = "github:frc4451/frc-nix"; 46 inputs.nixpkgs.follows = "nixpkgs"; 47 }; 48 49 claude-desktop = { 50 url = "github:k3d3/claude-desktop-linux-flake"; 51 inputs.nixpkgs.follows = "nixpkgs"; 52 }; 53 54 hyprland-contrib = { 55 url = "github:hyprwm/contrib"; 56 inputs.nixpkgs.follows = "nixpkgs"; 57 }; 58 59 nixvim.url = "github:taciturnaxolotl/nixvim"; 60 61 terminal-wakatime = { 62 url = "github:taciturnaxolotl/terminal-wakatime"; 63 inputs.nixpkgs.follows = "nixpkgs"; 64 }; 65 66 ctfd-alerts = { 67 url = "github:taciturnaxolotl/ctfd-alerts"; 68 inputs.nixpkgs.follows = "nixpkgs"; 69 }; 70 71 flare = { 72 url = "github:ByteAtATime/flare/feat/nix"; 73 inputs.nixpkgs.follows = "nixpkgs"; 74 }; 75 76 import-tree.url = "github:vic/import-tree"; 77 78 nur = { 79 url = "github:nix-community/NUR"; 80 inputs.nixpkgs.follows = "nixpkgs"; 81 }; 82 83 cedarlogic = { 84 url = "github:taciturnaxolotl/CedarLogic"; 85 inputs.nixpkgs.follows = "nixpkgs"; 86 }; 87 88 soapdump = { 89 url = "github:taciturnaxolotl/soapdump"; 90 inputs.nixpkgs.follows = "nixpkgs"; 91 }; 92 93 wakatime-ls = { 94 url = "github:mrnossiom/wakatime-ls"; 95 inputs.nixpkgs.follows = "nixpkgs"; 96 }; 97 98 deploy-rs = { 99 url = "github:serokell/deploy-rs"; 100 inputs.nixpkgs.follows = "nixpkgs"; 101 }; 102 }; 103 104 outputs = 105 { 106 self, 107 nixpkgs, 108 nixpkgs-unstable, 109 agenix, 110 home-manager, 111 nur, 112 nix-darwin, 113 deploy-rs, 114 ... 115 }@inputs: 116 let 117 outputs = inputs.self.outputs; 118 unstable-overlays = { 119 nixpkgs.overlays = [ 120 (final: prev: { 121 unstable = import nixpkgs-unstable { 122 system = final.system; 123 config.allowUnfree = true; 124 }; 125 126 bambu-studio = prev.bambu-studio.overrideAttrs (oldAttrs: { 127 version = "01.00.01.50"; 128 src = prev.fetchFromGitHub { 129 owner = "bambulab"; 130 repo = "BambuStudio"; 131 rev = "v01.00.01.50"; 132 hash = "sha256-7mkrPl2CQSfc1lRjl1ilwxdYcK5iRU//QGKmdCicK30="; 133 }; 134 }); 135 }) 136 ]; 137 }; 138 in 139 { 140 # NixOS configuration entrypoint 141 # Available through 'nixos-rebuild --flake .#hostname' 142 nixosConfigurations = { 143 moonlark = nixpkgs.lib.nixosSystem { 144 specialArgs = { inherit inputs outputs; }; 145 modules = [ 146 inputs.disko.nixosModules.disko 147 { disko.devices.disk.disk1.device = "/dev/vda"; } 148 agenix.nixosModules.default 149 unstable-overlays 150 ./machines/moonlark 151 nur.modules.nixos.default 152 ]; 153 }; 154 155 prattle = nixpkgs.lib.nixosSystem { 156 specialArgs = { inherit inputs outputs; }; 157 modules = [ 158 inputs.disko.nixosModules.disko 159 agenix.nixosModules.default 160 inputs.nixos-facter-modules.nixosModules.facter 161 { config.facter.reportPath = ./machines/prattle/facter.json; } 162 unstable-overlays 163 ./machines/prattle 164 nur.modules.nixos.default 165 ]; 166 }; 167 168 terebithia = nixpkgs.lib.nixosSystem { 169 specialArgs = { inherit inputs outputs; }; 170 modules = [ 171 inputs.disko.nixosModules.disko 172 agenix.nixosModules.default 173 inputs.nixos-facter-modules.nixosModules.facter 174 { config.facter.reportPath = ./machines/terebithia/facter.json; } 175 unstable-overlays 176 ./machines/terebithia 177 nur.modules.nixos.default 178 ]; 179 }; 180 }; 181 182 # Standalone home-manager configurations 183 # Available through 'home-manager --flake .#hostname' 184 homeConfigurations = { 185 "tacyon" = home-manager.lib.homeManagerConfiguration { 186 pkgs = nixpkgs.legacyPackages.aarch64-linux; 187 extraSpecialArgs = { 188 inherit inputs outputs; 189 nixpkgs-unstable = nixpkgs-unstable; 190 }; 191 modules = [ 192 ./machines/tacyon 193 unstable-overlays 194 ]; 195 }; 196 197 "nest" = home-manager.lib.homeManagerConfiguration { 198 pkgs = nixpkgs.legacyPackages.x86_64-linux; 199 extraSpecialArgs = { 200 inherit inputs outputs; 201 nixpkgs-unstable = nixpkgs-unstable; 202 system = "x86_64-linux"; 203 }; 204 modules = [ 205 ./machines/nest 206 unstable-overlays 207 ]; 208 }; 209 210 "ember" = home-manager.lib.homeManagerConfiguration { 211 pkgs = nixpkgs.legacyPackages.x86_64-linux; 212 extraSpecialArgs = { 213 inherit inputs outputs; 214 nixpkgs-unstable = nixpkgs-unstable; 215 }; 216 modules = [ 217 ./machines/ember 218 unstable-overlays 219 ]; 220 221 }; 222 "john" = home-manager.lib.homeManagerConfiguration { 223 pkgs = nixpkgs.legacyPackages.x86_64-linux; 224 extraSpecialArgs = { 225 inherit inputs outputs; 226 nixpkgs-unstable = nixpkgs-unstable; 227 system = "x86_64-linux"; 228 }; 229 modules = [ 230 ./machines/john 231 unstable-overlays 232 ]; 233 }; 234 }; 235 236 # Darwin configurations 237 # Available through 'darwin-rebuild switch --flake .#hostname' 238 darwinConfigurations = { 239 atalanta = nix-darwin.lib.darwinSystem { 240 system = "aarch64-darwin"; 241 specialArgs = { inherit inputs outputs; }; 242 modules = [ 243 home-manager.darwinModules.home-manager 244 agenix.darwinModules.default 245 unstable-overlays 246 ./machines/atalanta 247 ]; 248 }; 249 }; 250 251 formatter.x86_64-linux = nixpkgs.legacyPackages.x86_64-linux.nixfmt-tree; 252 formatter.aarch64-darwin = nixpkgs.legacyPackages.aarch64-darwin.nixfmt-tree; 253 254 # Deploy-rs configurations 255 deploy.nodes = { 256 # NixOS servers 257 prattle = { 258 hostname = "prattle"; 259 profiles.system = { 260 sshUser = "kierank"; 261 user = "root"; 262 path = deploy-rs.lib.x86_64-linux.activate.nixos self.nixosConfigurations.prattle; 263 }; 264 }; 265 266 terebithia = { 267 hostname = "terebithia"; 268 profiles.system = { 269 sshUser = "kierank"; 270 user = "root"; 271 path = deploy-rs.lib.aarch64-linux.activate.nixos self.nixosConfigurations.terebithia; 272 }; 273 }; 274 275 # Home-manager machines 276 nest = { 277 hostname = "nest"; 278 profiles.home = { 279 user = "kierank"; 280 path = deploy-rs.lib.x86_64-linux.activate.home-manager self.homeConfigurations.nest; 281 }; 282 }; 283 284 ember = { 285 hostname = "ember"; 286 profiles.home = { 287 user = "kierank"; 288 path = deploy-rs.lib.x86_64-linux.activate.home-manager self.homeConfigurations.ember; 289 }; 290 }; 291 }; 292 293 # Validation checks 294 checks = builtins.mapAttrs (system: deployLib: deployLib.deployChecks self.deploy) deploy-rs.lib; 295 }; 296}