diff --git a/hostHelper.nix b/hostHelper.nix index b6e7363..2bca73c 100644 --- a/hostHelper.nix +++ b/hostHelper.nix @@ -1,6 +1,11 @@ -inArgs: hostname: #{ - #${hostname} = inArgs.nixpkgs.lib.nixosSystem { - inArgs.nixpkgs.lib.nixosSystem { +inArgs: hostname: hostOptions: +let + nixosSystem = + if (hostOptions ? unstable && hostOptions.unstable) + then inArgs.nixos-unstable.lib.nixosSystem + else inArgs.nixpkgs.lib.nixosSystem; +in + nixosSystem { specialArgs = {inherit inArgs;}; modules = [ {networking.hostName = hostname;} diff --git a/outputs.nix b/outputs.nix index cbfd731..5f28acf 100644 --- a/outputs.nix +++ b/outputs.nix @@ -17,7 +17,7 @@ in { # NixOS configuration entrypoint # Available through 'nixos-rebuild --flake .#your-hostname' # to add more append // (host_helper example); - nixosConfigurations = builtins.mapAttrs (name: options: (hostHelper name)) { + nixosConfigurations = builtins.mapAttrs (hostName: hostOptions: (hostHelper hostName hostOptions)) { crocoite = {}; };