NixOS + home-manager configs, mirrored from GitLab SaaS. gitlab.com/andreijiroh-dev/nixops-config
nix-flake nixos home-manager nixpkgs nix-flakes
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

at e8a911e91a443b74c7eed09f8eee7ce006a6cdfd 570 lines 18 kB view raw
1{ 2 description = "Andrei Jiroh's NixOS and home-manager configurations (AKA declarative dotfiles)"; 3 nixConfig = { 4 extra-trusted-public-keys = [ 5 # cache.nixos.org 6 "cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=" 7 8 # cache.flakehub.com 9 "cache.flakehub.com-3:hJuILl5sVK4iKm86JzgdXW12Y2Hwd5G07qKtHTOcDCM=" 10 "cache.flakehub.com-4:Asi8qIv291s0aYLyH6IOnr5Kf6+OF14WVjkE6t3xMio=" 11 "cache.flakehub.com-5:zB96CRlL7tiPtzA9/WKyPkp3A2vqxqgdgyTVNGShPDU=" 12 "cache.flakehub.com-6:W4EGFwAGgBj3he7c5fNh9NkOXw0PUVaxygCVKeuvaqU=" 13 "cache.flakehub.com-7:mvxJ2DZVHn/kRxlIaxYNMuDG1OvMckZu32um1TadOR8=" 14 "cache.flakehub.com-8:moO+OVS0mnTjBTcOUh2kYLQEd59ExzyoW1QgQ8XAARQ=" 15 "cache.flakehub.com-9:wChaSeTI6TeCuV/Sg2513ZIM9i0qJaYsF+lZCXg0J6o=" 16 "cache.flakehub.com-10:2GqeNlIp6AKp4EF2MVbE1kBOp9iBSyo0UPR9KoR0o1Y=" 17 18 # nix-community 19 "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=" 20 21 # devenv.sh 22 "devenv.cachix.org-1:w1cLUi8dv3hnoSPGAuibQv+f9TZLr6cv/Hm9XgU50cw=" 23 24 # my caches for nixos and nixpkgs related builds (including devenvs) 25 "ajhalili2006-nixos-builds.cachix.org-1:fA8HXvGR1i792D+CxL2iW/TQzUcyoW7zPUmC9Q4mQLg=" 26 27 # the main cache itself 28 "andreijiroh-dev.cachix.org-1:7Jd0STdBOLiNu5fiA+AKwcMqQD2PA1j9zLDGyDkuyBo=" 29 30 # recaptime.dev cache 31 "recaptime-dev.cachix.org-1:b0UBO1zONf6ceTIoR06AKhgid4ZOl5kxB/gOIdZ9J6g=" 32 33 # numtide 34 "niks3.numtide.com-1:DTx8wZduET09hRmMtKdQDxNNthLQETkc/yaX7M4qK0g=" 35 ]; 36 37 # also list them all too 38 extra-trusted-substituters = [ 39 "https://cache.nixos.org" 40 "https://cache.flakehub.com" 41 "https://nix-community.cachix.org" 42 "https://devenv.cachix.org" 43 "https://andreijiroh-dev.cachix.org" 44 "https://ajhalili2006-nixos-builds.cachix.org" 45 "https://recaptime-dev.cachix.org" 46 "https://cache.numtide.com" 47 ]; 48 }; 49 50 # try to be in-sync with the nix-channels 51 inputs = { 52 # nixpkgs essientials 53 lib.url = "github:nix-community/nixpkgs.lib"; 54 nixpkgs.url = "https://flakehub.com/f/DeterminateSystems/nixpkgs-weekly/*.tar.gz"; 55 flake-utils = { 56 url = "github:numtide/flake-utils"; 57 inputs = { 58 systems = { 59 follows = "systems"; 60 }; 61 }; 62 }; 63 nixos-generators = { 64 url = "github:nix-community/nixos-generators"; 65 inputs.nixpkgs.follows = "nixpkgs"; 66 }; 67 systems = { 68 url = "github:nix-systems/default"; 69 }; 70 71 # home-manager 72 home-manager = { 73 url = "github:nix-community/home-manager/master"; 74 inputs.nixpkgs.follows = "nixpkgs"; 75 }; 76 77 # Determinate Nix 78 determinate = { 79 url = "https://flakehub.com/f/DeterminateSystems/determinate/0.1"; 80 inputs.nixpkgs.follows = "nixpkgs"; 81 }; 82 83 # NixOS hardware stuff 84 nixos-hardware.url = "github:NixOS/nixos-hardware/master"; 85 86 # vscode-server setup 87 vscode-server = { 88 url = "github:nix-community/nixos-vscode-server"; 89 inputs = { 90 nixpkgs.follows = "nixpkgs"; 91 flake-utils.follows = "flake-utils"; 92 }; 93 }; 94 nix4vscode = { 95 url = "github:nix-community/nix4vscode"; 96 inputs.nixpkgs.follows = "nixpkgs"; 97 inputs.systems.follows = "systems"; 98 }; 99 100 # Firefox and friends 101 zen-browser = { 102 url = "github:0xc000022070/zen-browser-flake"; 103 inputs = { 104 nixpkgs.follows = "nixpkgs"; 105 home-manager.follows = "home-manager"; 106 }; 107 }; 108 firefox-addons = { 109 url = "gitlab:rycee/nur-expressions?dir=pkgs/firefox-addons"; 110 inputs.nixpkgs.follows = "nixpkgs"; 111 }; 112 113 # nix-ld 114 nix-ld = { 115 url = "github:Mic92/nix-ld"; 116 inputs.nixpkgs.follows = "nixpkgs"; 117 }; 118 119 # agenix and friends for SecretOps 120 agenix = { 121 url = "github:ryantm/agenix"; 122 inputs.nixpkgs.follows = "nixpkgs"; 123 inputs.systems.follows = "systems"; 124 }; 125 agenix-rekey = { 126 url = "github:oddlama/agenix-rekey"; 127 # Make sure to override the nixpkgs version to follow your flake, 128 # otherwise derivation paths can mismatch (when using storageMode = "derivation"), 129 # resulting in the rekeyed secrets not being found! 130 inputs.nixpkgs.follows = "nixpkgs"; 131 }; 132 133 chaotic = { 134 url = "https://flakehub.com/f/chaotic-cx/nyx/*.tar.gz"; 135 inputs = { 136 nixpkgs.follows = "nixpkgs"; 137 }; 138 }; 139 140 llm-agents = { 141 url = "github:numtide/llm-agents.nix"; 142 inputs.nixpkgs.follows = "nixpkgs"; 143 }; 144 }; 145 outputs = 146 inputs@{ 147 self, 148 nixpkgs, 149 home-manager, 150 nixos-hardware, 151 determinate, 152 vscode-server, 153 nix-ld, 154 flake-utils, 155 systems, 156 nixos-generators, 157 lib, 158 zen-browser, 159 nix4vscode, 160 firefox-addons, 161 agenix, 162 agenix-rekey, 163 chaotic, 164 llm-agents, 165 }: 166 let 167 dev-pkgs = import ./pkgs; 168 169 # Reusable overlay function for any system 170 overlayFor = system: final: prev: { 171 coolify-compose = prev.callPackage ./pkgs/coolify-compose.nix { }; 172 detect-vscode-for-git = prev.callPackage ./pkgs/detect-vscode-for-git.nix { }; 173 ssh-agent-loader = prev.callPackage ./pkgs/ssh-agent-loader.nix { }; 174 }; 175 in 176 flake-utils.lib.eachDefaultSystem ( 177 system: 178 let 179 pkgs = import nixpkgs { inherit system; }; 180 in 181 { 182 # Packages for this system 183 packages = { 184 coolify-compose = pkgs.callPackage ./pkgs/coolify-compose.nix { }; 185 detect-vscode-for-git = pkgs.callPackage ./pkgs/detect-vscode-for-git.nix { }; 186 ssh-agent-loader = pkgs.callPackage ./pkgs/ssh-agent-loader.nix { }; 187 188 # Optionally make one the default to support `nix profile add .#` 189 default = pkgs.callPackage ./pkgs/coolify-compose.nix { }; 190 191 live-cd = (nixpkgs.lib.nixosSystem { 192 inherit system; 193 modules = [ 194 ({ ... }: { 195 _module.args = { inherit self nix4vscode llm-agents; }; 196 }) 197 nix-ld.nixosModules.nix-ld 198 determinate.nixosModules.default 199 home-manager.nixosModules.home-manager 200 vscode-server.nixosModules.default 201 chaotic.nixosModules.default 202 ./hosts/live-cd/kde-plasma.nix 203 ]; 204 specialArgs = { 205 inherit 206 zen-browser 207 nix4vscode 208 self 209 chaotic 210 nixpkgs 211 llm-agents 212 ; 213 }; 214 }).config.system.build.isoImage; 215 }; 216 217 # If you want app-style outputs, you can also define apps here: 218 # apps.default = { 219 # type = "app"; 220 # program = "${self.packages.${system}.coolify-compose}/bin/coolify-compose"; 221 # }; 222 223 # Keep nixosConfigurations and homeConfigurations outside of eachDefaultSystem 224 # or gate them by `system` if needed; shown below outside the lambda. 225 } 226 ) 227 // { 228 # Top-level overlays for downstream consumers 229 overlays = { 230 # System-aware default overlay that works regardless of the system 231 default = 232 final: prev: 233 let 234 sys = final.system or prev.stdenv.system or "x86_64-linux"; 235 in 236 (overlayFor sys) final prev; 237 238 # Per-system overlays for compatibility 239 x86_64-linux = overlayFor "x86_64-linux"; 240 aarch64-linux = overlayFor "aarch64-linux"; 241 x86_64-darwin = overlayFor "x86_64-darwin"; 242 aarch64-darwin = overlayFor "aarch64-darwin"; 243 }; 244 245 nixosConfigurations = { 246 recoverykit-amd64 = nixpkgs.lib.nixosSystem { 247 system = "x86_64-linux"; 248 modules = [ 249 ( 250 { ... }: 251 { 252 _module.args = { inherit self nix4vscode llm-agents; }; 253 } 254 ) 255 # nix flake modules first 256 nix-ld.nixosModules.nix-ld 257 determinate.nixosModules.default 258 home-manager.nixosModules.home-manager 259 vscode-server.nixosModules.default 260 261 # and then the configs 262 ./shared/meta.nix 263 ./hosts/recoverykit/configuration.nix 264 "${nixpkgs}/nixos/modules/installer/cd-dvd/installation-cd-minimal.nix" 265 ]; 266 267 specialArgs = { 268 inherit zen-browser nix4vscode self; 269 }; 270 }; 271 272 portable-amd64-256gb = nixpkgs.lib.nixosSystem { 273 system = "x86_64-linux"; 274 modules = [ 275 ( 276 { ... }: 277 { 278 _module.args = { inherit self nix4vscode llm-agents; }; 279 } 280 ) 281 # nix flake modules first 282 nix-ld.nixosModules.nix-ld 283 determinate.nixosModules.default 284 home-manager.nixosModules.home-manager 285 vscode-server.nixosModules.default 286 287 # and then the configs 288 ./shared/meta.nix 289 ./hosts/portable/amd64/configuration.nix 290 ]; 291 292 specialArgs = { 293 inherit zen-browser self; 294 }; 295 }; 296 297 lairland = nixpkgs.lib.nixosSystem { 298 system = "x86_64-linux"; 299 modules = [ 300 ( 301 { ... }: 302 { 303 _module.args = { inherit self nix4vscode llm-agents; }; 304 } 305 ) 306 # nix flake modules first 307 nix-ld.nixosModules.nix-ld 308 determinate.nixosModules.default 309 home-manager.nixosModules.home-manager 310 vscode-server.nixosModules.default 311 chaotic.nixosModules.default 312 313 # and then the configs 314 ./shared/meta.nix 315 ./hosts/lairland/configuration.nix 316 ]; 317 318 specialArgs = { 319 inherit zen-browser self chaotic; 320 }; 321 }; 322 323 stellapent-cier = nixpkgs.lib.nixosSystem { 324 # for some reason, zen-browser needs to be imported before nixos-hardware 325 # otherwise, it fails to build with some missing dependencies 326 system = "x86_64-linux"; 327 modules = [ 328 ( 329 { ... }: 330 { 331 _module.args = { inherit self nix4vscode llm-agents; }; 332 } 333 ) 334 nix-ld.nixosModules.nix-ld 335 determinate.nixosModules.default 336 home-manager.nixosModules.home-manager 337 vscode-server.nixosModules.default 338 chaotic.nixosModules.default 339 ./shared/meta.nix 340 ./hosts/stellapent-cier/configuration.nix 341 ]; 342 specialArgs = { 343 inherit 344 zen-browser 345 nix4vscode 346 self 347 chaotic 348 llm-agents 349 ; 350 }; 351 }; 352 353 live-cd-minimal = nixpkgs.lib.nixosSystem { 354 system = "x86_64-linux"; 355 modules = [ 356 ( 357 { ... }: 358 { 359 _module.args = { inherit self nix4vscode llm-agents; }; 360 } 361 ) 362 nix-ld.nixosModules.nix-ld 363 determinate.nixosModules.default 364 home-manager.nixosModules.home-manager 365 vscode-server.nixosModules.default 366 chaotic.nixosModules.default 367 ./hosts/live-cd/base.nix 368 ]; 369 specialArgs = { 370 inherit 371 zen-browser 372 nix4vscode 373 self 374 chaotic 375 nixpkgs 376 llm-agents 377 ; 378 }; 379 }; 380 381 live-cd-graphical = nixpkgs.lib.nixosSystem { 382 system = "x86_64-linux"; 383 modules = [ 384 ( 385 { ... }: 386 { 387 _module.args = { inherit self nix4vscode llm-agents; }; 388 } 389 ) 390 nix-ld.nixosModules.nix-ld 391 determinate.nixosModules.default 392 home-manager.nixosModules.home-manager 393 vscode-server.nixosModules.default 394 chaotic.nixosModules.default 395 ./hosts/live-cd/kde-plasma.nix 396 ]; 397 specialArgs = { 398 inherit 399 zen-browser 400 nix4vscode 401 self 402 chaotic 403 nixpkgs 404 llm-agents 405 ; 406 }; 407 }; 408 }; 409 homeConfigurations = { 410 # Usage 411 # - From GitHub: 412 # nix run home-manager/master -- switch --flake github:andreijiroh-dev/nixops-config#stellapent-cier 413 # - Locally: 414 # nix run home-manager/master -- switch --flake .#stellapent-cier 415 stellapent-cier = home-manager.lib.homeManagerConfiguration { 416 inherit lib; 417 pkgs = nixpkgs.legacyPackages.x86_64-linux; 418 extraSpecialArgs = { 419 inherit 420 self 421 dev-pkgs 422 zen-browser 423 nix4vscode 424 chaotic 425 llm-agents 426 ; 427 }; 428 modules = [ 429 { 430 nixpkgs = { 431 overlays = [ 432 self.overlays.default 433 nix4vscode.overlays.default 434 ]; 435 config = { 436 allowUnfree = true; 437 # https://github.com/nix-community/home-manager/issues/2942 438 allowUnfreePredicate = (_: true); 439 }; 440 }; 441 } 442 zen-browser.homeModules.beta 443 chaotic.homeManagerModules.default 444 ./shared/home-manager/main.nix 445 { 446 home = { 447 username = "gildedguy"; 448 homeDirectory = "/home/gildedguy"; 449 }; 450 } 451 ]; 452 }; 453 454 # Usage 455 # - From GitHub: 456 # nix run home-manager/master -- switch --flake github:andreijiroh-dev/nixops-config#plain 457 # - Locally: 458 # nix run home-manager/master -- switch --flake .#plain 459 plain = home-manager.lib.homeManagerConfiguration { 460 pkgs = nixpkgs.legacyPackages.x86_64-linux; 461 extraSpecialArgs = { 462 inherit 463 self 464 dev-pkgs 465 zen-browser 466 nix4vscode 467 chaotic 468 llm-agents 469 ; 470 }; 471 modules = [ 472 { 473 nixpkgs = { 474 overlays = [ 475 self.overlays.default 476 nix4vscode.overlays.default 477 llm-agents.overlays.default 478 ]; 479 config = { 480 allowUnfree = true; 481 # https://github.com/nix-community/home-manager/issues/2942 482 allowUnfreePredicate = (_: true); 483 }; 484 }; 485 } 486 zen-browser.homeModules.beta 487 chaotic.homeManagerModules.default 488 ./shared/home-manager/nogui.nix 489 { 490 home.username = "ajhalili2006"; 491 home.homeDirectory = "/home/ajhalili2006"; 492 } 493 ]; 494 }; 495 496 # Usage 497 # - From GitHub: 498 # nix run home-manager/master -- switch --flake github:andreijiroh-dev/nixops-config#arm64-plain 499 # - Locally: 500 # nix run home-manager/master -- switch --flake .#arm64-plain 501 arm64-plain = home-manager.lib.homeManagerConfiguration { 502 pkgs = nixpkgs.legacyPackages.aarch64-linux; 503 extraSpecialArgs = { 504 inherit 505 self 506 dev-pkgs 507 zen-browser 508 nix4vscode 509 chaotic 510 llm-agents 511 ; 512 }; 513 modules = [ 514 { 515 nixpkgs = { 516 overlays = [ 517 self.overlays.default 518 nix4vscode.overlays.default 519 llm-agents.overlays.default 520 ]; 521 config = { 522 allowUnfree = true; 523 # https://github.com/nix-community/home-manager/issues/2942 524 allowUnfreePredicate = (_: true); 525 }; 526 }; 527 } 528 zen-browser.homeModules.beta 529 chaotic.homeManagerModules.default 530 ./shared/home-manager/nogui.nix 531 { 532 home.username = "ajhalili2006"; 533 home.homeDirectory = "/home/ajhalili2006"; 534 } 535 ]; 536 }; 537 }; 538 539 # This is for external users who want to reproduce my configs as needed 540 exportedConfigs = { 541 meta = ./shared/meta.nix; 542 base = { 543 sshKeys = ./shared/ssh-keys.nix; 544 hostsFile = ./shared/hosts-file.nix; 545 systemd = ./shared/systemd.nix; 546 networking = ./shared/networking.nix; 547 locale = ./shared/locale.nix; 548 gnupg = ./shared/gnupg.nix; 549 metaConfigs = ./shared/nix.nix; 550 shells = { 551 bash = ./shared/shells/bash.nix; 552 customPrompts = ./shared/shells/custom-prompts.nix; 553 }; 554 }; 555 desktop = { 556 kdePlasma = ./shared/desktop/kde-plasma.nix; 557 base = ./shared/desktop/base.nix; 558 flatpak = ./shared/desktop/flatpak.nix; 559 _1password = ./shared/desktop/1password.nix; 560 }; 561 server = { 562 devenv = ./shared/server/devenv.nix; 563 ssh = ./shared/server/ssh.nix; 564 firewall = ./shared/server/firewall.nix; 565 tailscale = ./shared/server/tailscale.nix; 566 cockpit = ./shared/server/cockpit.nix; 567 }; 568 }; 569 }; 570}