diff options
| author | Tim Keller <tjk@tjkeller.xyz> | 2025-12-06 19:11:34 -0600 |
|---|---|---|
| committer | Tim Keller <tjk@tjkeller.xyz> | 2025-12-06 19:11:34 -0600 |
| commit | 19200e70db09118dc47499b942c319cf5c2b937a (patch) | |
| tree | 039c18128719b85eb2e9ddc686e5613cb0ffe2c6 /flake.nix | |
| parent | 9ff124c8029f505ebfdc79ec53a233ed5228123f (diff) | |
| download | nixos-19200e70db09118dc47499b942c319cf5c2b937a.tar.xz nixos-19200e70db09118dc47499b942c319cf5c2b937a.zip | |
fix rebuild and cleanup flake.nix and add support for multiple system hosts of different archetecturespiframe
Diffstat (limited to 'flake.nix')
| -rw-r--r-- | flake.nix | 84 |
1 files changed, 46 insertions, 38 deletions
@@ -18,44 +18,48 @@ rec { }; }; - outputs = { nixpkgs, ... }@inputs : - let - system = "x86_64-linux"; - extLib = nixpkgs.lib.extend (final: prev: import ./lib); - mkNixosConfiguration = hostname: nixpkgs.lib.nixosSystem { - inherit system; - specialArgs = { - inherit inputs; - inherit hostname; - lib = extLib; - }; - modules = [ - ./hosts/${hostname}/configuration.nix - ./hosts/${hostname}/hardware-configuration.nix - ./archetypes - ./nixos - ./pkgs - ./users - inputs.sops-nix.nixosModules.sops - inputs.home-manager.nixosModules.home-manager { - home-manager = { - backupFileExtension = "backup"; # In case file is overwritten - useGlobalPkgs = true; - useUserPackages = true; - sharedModules = [ - inputs.arkenfox.hmModules.arkenfox - ./home-manager - ]; - }; - } - ]; + outputs = { nixpkgs, ... }@inputs: let + extLib = nixpkgs.lib.extend (final: prev: import ./lib); + mkNixosConfiguration = system: hostname: nixpkgs.lib.nixosSystem { + inherit system; + specialArgs = { + inherit inputs; + inherit hostname; + lib = extLib; }; - in { - nixosConfigurations = builtins.listToAttrs (map (hostname: { - name = hostname; - value = mkNixosConfiguration hostname; - }) [ - # Configured system hostnames go here + modules = [ + ./hosts/${hostname}/configuration.nix + ./hosts/${hostname}/hardware-configuration.nix + ./archetypes + ./nixos + ./pkgs + ./users + inputs.sops-nix.nixosModules.sops + inputs.home-manager.nixosModules.home-manager { + home-manager = { + backupFileExtension = "backup"; # In case file is overwritten + useGlobalPkgs = true; + useUserPackages = true; + sharedModules = [ + inputs.arkenfox.hmModules.arkenfox + ./home-manager + ]; + }; + } + ]; + }; + mkNixosConfigurations = hostsBySystem: builtins.listToAttrs ( + builtins.concatMap (system: + map (host: { + name = host; + value = mkNixosConfiguration system host; + }) hostsBySystem.${system} + ) (builtins.attrNames hostsBySystem) + ); + in { + # Configured system hostnames go here under their respective system architecture + nixosConfigurations = mkNixosConfigurations { + x86_64-linux = [ "T495" "X230" "flex-wg-router" @@ -63,6 +67,10 @@ rec { "libreX60" "optiplex" "poweredge" - ]); + ]; + aarch64-linux = [ + "piframe" + ]; }; + }; } |
