Nix config files for my laptop and servers
0

Configure Feed

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

seafoam / flake.nix
2.5 kB 105 lines
1{ 2 description = "A full rewrite of my system configuration"; 3 4 inputs = { 5 nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; 6 7 home-manager = { 8 url = "github:nix-community/home-manager/master"; 9 inputs.nixpkgs.follows = "nixpkgs"; 10 }; 11 12 nixos-hardware.url = "github:NixOS/nixos-hardware/master"; 13 14 agenix.url = "github:ryantm/agenix"; 15 16 disko = { 17 url = "github:nix-community/disko"; 18 inputs.nixpkgs.follows = "nixpkgs"; 19 }; 20 21 niri = { 22 url = "github:sodiboo/niri-flake"; 23 inputs.nixpkgs.follows = "nixpkgs"; 24 }; 25 26 noctalia = { 27 url = "github:noctalia-dev/noctalia/legacy-v4"; 28 inputs.nixpkgs.follows = "nixpkgs"; 29 }; 30 }; 31 32 outputs = inputs @ { 33 nixpkgs, 34 home-manager, 35 nixos-hardware, 36 agenix, 37 disko, 38 ... 39 }: let 40 lib = nixpkgs.lib; 41 createSystem = { 42 host, 43 user, 44 platform, 45 optionalModules ? [], 46 }: 47 lib.nixosSystem { 48 specialArgs = {inherit inputs;}; 49 modules = 50 [ 51 ./hosts/${host} 52 ./users/${user} 53 home-manager.nixosModules.home-manager 54 { 55 home-manager.useGlobalPkgs = true; 56 home-manager.useUserPackages = true; 57 home-manager.backupFileExtension = "bak"; 58 home-manager.users.${user} = import ./users/${user}/platforms/${platform}.nix; 59 home-manager.extraSpecialArgs = {inherit inputs;}; 60 } 61 ] 62 ++ optionalModules; 63 }; 64 in { 65 nixosConfigurations = { 66 seafoam = createSystem { 67 host = "seafoam"; 68 user = "hari"; 69 platform = "pc"; 70 optionalModules = [ 71 nixos-hardware.nixosModules.dell-inspiron-14-5420 72 ]; 73 }; 74 75 cerulean = createSystem { 76 host = "cerulean"; 77 user = "hari"; 78 platform = "server"; 79 optionalModules = [ 80 agenix.nixosModules.default 81 ]; 82 }; 83 84 verdigris = createSystem { 85 host = "verdigris"; 86 user = "hari"; 87 platform = "server"; 88 optionalModules = [ 89 disko.nixosModules.disko 90 agenix.nixosModules.default 91 ]; 92 }; 93 94 cyan = createSystem { 95 host = "cyan"; 96 user = "hari"; 97 platform = "server"; 98 optionalModules = [ 99 disko.nixosModules.disko 100 agenix.nixosModules.default 101 ]; 102 }; 103 }; 104 }; 105}