feat(buildInventory): move instance resolution into buildInventory
Such that buildClan doesn't have to compose the results buildInventory should be more self contained. But it is NOT meant a public API! use buildClan argument 'inventory' instead
This commit is contained in:
@@ -8,7 +8,11 @@ let
|
||||
machinesFromInventory :: Inventory -> { ${machine_name} :: NixOSConfiguration }
|
||||
*/
|
||||
buildInventory =
|
||||
{ inventory, directory }:
|
||||
{
|
||||
inventory,
|
||||
directory,
|
||||
flakeInputs,
|
||||
}:
|
||||
(lib.evalModules {
|
||||
specialArgs = {
|
||||
inherit clanLib;
|
||||
@@ -16,6 +20,19 @@ let
|
||||
modules = [
|
||||
./builder
|
||||
{ inherit directory inventory; }
|
||||
(
|
||||
# config.distributedServices.allMachines.${name} or [ ];
|
||||
{ config, ... }:
|
||||
{
|
||||
distributedServices = clanLib.inventory.mapInstances {
|
||||
inherit (config) inventory;
|
||||
inherit flakeInputs;
|
||||
};
|
||||
machines = lib.mapAttrs (machineName: v: {
|
||||
machineImports = v;
|
||||
}) config.distributedServices.allMachines;
|
||||
}
|
||||
)
|
||||
];
|
||||
}).config;
|
||||
in
|
||||
|
||||
Reference in New Issue
Block a user