diff --git a/flake.nix b/flake.nix index 7b57649..0c69d12 100644 --- a/flake.nix +++ b/flake.nix @@ -20,13 +20,14 @@ in { builtins.replaceStrings [ ".nix" ] [ "" ] filename; hosts = map hostname-from-file (lib.attrNames (lib.filterAttrs is-nix-file (lib.filterAttrs is-regular-file (builtins.readDir hosts-path)))); + hostsOpts = lib.listToAttrs (hostname: + lib.nameValuePair hostname (import hosts-path + "/${hostname}.nix")); pkgs = import nixpkgs { }; in { - nixConfigurations = lib.mapAttrs (hostname: - let hostOpts = import hosts-path + "/${hostname}.nix"; - in lib.nixosSystem { + nixConfigurations = lib.mapAttrs (hostname: hostOpts: + lib.nixosSystem { system = hostOpts.platform; modules = [ (import ./initialize.nix { @@ -36,6 +37,6 @@ in { include-secrets = true; }) ]; - }) hosts; + }) hostsOpts; }; }