From 0431b8652510aec42739127818268d398a30af9a Mon Sep 17 00:00:00 2001 From: Zynh Ludwig Date: Fri, 28 Jun 2024 06:44:15 -0700 Subject: [PATCH] generic nixosConfigurations --- flake.nix | 63 ++++++++++++++++++++++++++++++++++--------------------- 1 file changed, 39 insertions(+), 24 deletions(-) diff --git a/flake.nix b/flake.nix index 99ec9a6..3a19b1a 100644 --- a/flake.nix +++ b/flake.nix @@ -19,34 +19,49 @@ outputs = { self, nixpkgs, ... }@inputs: { - nixosConfigurations = { - snowhawk = nixpkgs.lib.nixosSystem { + nixosConfigurations = map + ({ hostname, system }: { + inherit system; specialArgs = { inherit inputs; }; - system = "x86_64-linux"; modules = [ - ./hosts/snowhawk/hardware-configuration.nix + ./hosts/${hostname}/hardware-configuration.nix ./configuration.nix inputs.home-manager.nixosModules.default ]; - }; - sprite = nixpkgs.lib.nixosSystem { - specialArgs = { inherit inputs; }; - system = "aarch64-linux"; - modules = [ - ./hosts/sprite/hardware-configuration.nix - ./configuration.nix - inputs.home-manager.nixosModules.default - ]; - }; - nixos = nixpkgs.lib.nixosSystem { - specialArgs = { inherit inputs; }; - system = "x86_64-linux"; - modules = [ - ./hosts/nixos/hardware-configuration.nix - ./configuration.nix - inputs.home-manager.nixosModules.default - ]; - }; - }; + }) + [ + { hostname = "snowhawk"; system = "x86_64-linux"; } + { hostname = "sprite"; system = "aarch64-linux"; } + { hostname = "nixos"; system = "x86_64-linux"; } + ]; + # { + # snowhawk = nixpkgs.lib.nixosSystem { + # specialArgs = { inherit inputs; }; + # system = "x86_64-linux"; + # modules = [ + # ./hosts/snowhawk/hardware-configuration.nix + # ./configuration.nix + # inputs.home-manager.nixosModules.default + # ]; + # }; + # sprite = nixpkgs.lib.nixosSystem { + # specialArgs = { inherit inputs; }; + # system = "aarch64-linux"; + # modules = [ + # ./hosts/sprite/hardware-configuration.nix + # ./configuration.nix + # inputs.home-manager.nixosModules.default + # ]; + # }; + # nixos = nixpkgs.lib.nixosSystem { + # specialArgs = { inherit inputs; }; + # system = "x86_64-linux"; + # modules = [ + # ./hosts/nixos/hardware-configuration.nix + # ./configuration.nix + # inputs.home-manager.nixosModules.default + # ]; + # }; + # }; }; }