diff --git a/modules/hosts/alpha/default.nix b/modules/hosts/alpha/default.nix deleted file mode 100644 index ea6e18e..0000000 --- a/modules/hosts/alpha/default.nix +++ /dev/null @@ -1,30 +0,0 @@ -{ - inputs, - config, - ... -}: -let - hostName = "alpha"; - userName = "tux"; - userEmail = "t@tux.rs"; - system = "x86_64-linux"; - unstable = true; - nixpkgs = if unstable then inputs.nixpkgs else inputs.nixpkgs-stable; -in -{ - flake.nixosConfigurations."${hostName}" = nixpkgs.lib.nixosSystem { - inherit system; - specialArgs = { - inherit - hostName - userName - userEmail - system - ; - }; - modules = [ - config.flake.modules.nixos.core - config.flake.modules.nixos.${hostName} - ]; - }; -} diff --git a/modules/hosts/arcturus/default.nix b/modules/hosts/arcturus/default.nix deleted file mode 100644 index e4f6c8e..0000000 --- a/modules/hosts/arcturus/default.nix +++ /dev/null @@ -1,30 +0,0 @@ -{ - inputs, - config, - ... -}: -let - hostName = "arcturus"; - userName = "tux"; - userEmail = "t@tux.rs"; - system = "x86_64-linux"; - unstable = true; - nixpkgs = if unstable then inputs.nixpkgs else inputs.nixpkgs-stable; -in -{ - flake.nixosConfigurations."${hostName}" = nixpkgs.lib.nixosSystem { - inherit system; - specialArgs = { - inherit - hostName - userName - userEmail - system - ; - }; - modules = [ - config.flake.modules.nixos.core - config.flake.modules.nixos.${hostName} - ]; - }; -} diff --git a/modules/hosts/canopus/default.nix b/modules/hosts/canopus/default.nix deleted file mode 100644 index a9b3e47..0000000 --- a/modules/hosts/canopus/default.nix +++ /dev/null @@ -1,30 +0,0 @@ -{ - inputs, - config, - ... -}: -let - hostName = "canopus"; - userName = "tux"; - userEmail = "t@tux.rs"; - system = "x86_64-linux"; - unstable = true; - nixpkgs = if unstable then inputs.nixpkgs else inputs.nixpkgs-stable; -in -{ - flake.nixosConfigurations."${hostName}" = nixpkgs.lib.nixosSystem { - inherit system; - specialArgs = { - inherit - hostName - userName - userEmail - system - ; - }; - modules = [ - config.flake.modules.nixos.core - config.flake.modules.nixos.${hostName} - ]; - }; -} diff --git a/modules/hosts/default.nix b/modules/hosts/default.nix new file mode 100644 index 0000000..6ccb964 --- /dev/null +++ b/modules/hosts/default.nix @@ -0,0 +1,83 @@ +{ + inputs, + outputs, + config, + ... +}: +let + mkHost = + hostName: + { + userName ? "tux", + userEmail ? "t@tux.rs", + system ? "x86_64-linux", + unstable ? true, + }: + let + nixpkgs = if unstable then inputs.nixpkgs else inputs.nixpkgs-stable; + in + nixpkgs.lib.nixosSystem { + inherit system; + specialArgs = { + inherit + hostName + userName + userEmail + system + ; + }; + modules = [ + config.flake.modules.nixos.core + config.flake.modules.nixos.${hostName} + ]; + }; + + mkDroidHost = + hostName: + { + userName ? "nix-on-droid", + userEmail ? "t@tux.rs", + system ? "aarch64-linux", + unstable ? true, + }: + let + nixpkgs = if unstable then inputs.nixpkgs else inputs.nixpkgs-stable; + in + inputs.nix-on-droid.lib.nixOnDroidConfiguration { + pkgs = import nixpkgs { + inherit system; + config = { + allowUnfree = true; + joypixels.acceptLicense = true; + }; + overlays = builtins.attrValues inputs.self.overlays; + }; + extraSpecialArgs = { + inherit + inputs + outputs + hostName + userName + userEmail + ; + }; + modules = [ + config.flake.modules.droid.core + config.flake.modules.droid.networking + config.flake.modules.droid.${hostName} + ]; + }; +in +{ + flake.nixosConfigurations = builtins.mapAttrs mkHost { + alpha = { }; + arcturus = { }; + canopus = { }; + sirius = { }; + vps = { }; + }; + + flake.nixOnDroidConfigurations = builtins.mapAttrs mkDroidHost { + vega = { }; + }; +} diff --git a/modules/hosts/sirius/default.nix b/modules/hosts/sirius/default.nix deleted file mode 100644 index d9b5f9b..0000000 --- a/modules/hosts/sirius/default.nix +++ /dev/null @@ -1,30 +0,0 @@ -{ - inputs, - config, - ... -}: -let - hostName = "sirius"; - userName = "tux"; - userEmail = "t@tux.rs"; - system = "x86_64-linux"; - unstable = true; - nixpkgs = if unstable then inputs.nixpkgs else inputs.nixpkgs-stable; -in -{ - flake.nixosConfigurations."${hostName}" = nixpkgs.lib.nixosSystem { - inherit system; - specialArgs = { - inherit - hostName - userName - userEmail - system - ; - }; - modules = [ - config.flake.modules.nixos.core - config.flake.modules.nixos.${hostName} - ]; - }; -} diff --git a/modules/hosts/vega/default.nix b/modules/hosts/vega/default.nix deleted file mode 100644 index 5a5626c..0000000 --- a/modules/hosts/vega/default.nix +++ /dev/null @@ -1,41 +0,0 @@ -{ - inputs, - outputs, - config, - ... -}: -let - hostName = "vega"; - userName = "nix-on-droid"; - userEmail = "t@tux.rs"; - system = "aarch64-linux"; - unstable = true; - nixpkgs = if unstable then inputs.nixpkgs else inputs.nixpkgs-stable; -in -{ - flake.nixOnDroidConfigurations."${hostName}" = inputs.nix-on-droid.lib.nixOnDroidConfiguration { - pkgs = import nixpkgs { - system = system; - config = { - allowUnfree = true; - joypixels.acceptLicense = true; - }; - overlays = builtins.attrValues inputs.self.overlays; - }; - extraSpecialArgs = { - inherit - inputs - outputs - hostName - userName - userEmail - ; - }; - - modules = [ - config.flake.modules.droid.core - config.flake.modules.droid.networking - config.flake.modules.droid.${hostName} - ]; - }; -} diff --git a/modules/hosts/vps/default.nix b/modules/hosts/vps/default.nix deleted file mode 100644 index 600077d..0000000 --- a/modules/hosts/vps/default.nix +++ /dev/null @@ -1,30 +0,0 @@ -{ - inputs, - config, - ... -}: -let - hostName = "vps"; - userName = "tux"; - userEmail = "t@tux.rs"; - system = "x86_64-linux"; - unstable = true; - nixpkgs = if unstable then inputs.nixpkgs else inputs.nixpkgs-stable; -in -{ - flake.nixosConfigurations."${hostName}" = nixpkgs.lib.nixosSystem { - inherit system; - specialArgs = { - inherit - hostName - userName - userEmail - system - ; - }; - modules = [ - config.flake.modules.nixos.core - config.flake.modules.nixos.${hostName} - ]; - }; -}