feat(inventory/instances): add service result to nixos machines

This commit is contained in:
Johannes Kirschbauer
2025-03-29 17:48:24 +01:00
parent 1879ca38cc
commit b85705ff63
2 changed files with 13 additions and 1 deletions

View File

@@ -77,6 +77,9 @@ let
# Inherit the inventory assertions ?
# { inherit (mergedInventory) assertions; }
{ imports = inventoryClass.machines.${name}.machineImports or [ ]; }
# Import the distribute services
{ imports = config.clanInternals.distributedServices.allMachines.${name} or []; }
(
{
# Settings

View File

@@ -183,8 +183,17 @@ let
];
}
) { } importedModuleWithInstances;
# TODO: Return an attribute set of resources instead of a plain list of nixosModules
allMachines = lib.foldlAttrs (
acc: _name: eval:
acc
// lib.mapAttrs (
machineName: result: acc.${machineName} or [ ] ++ [ result.nixosModule ]
) eval.config.result.final
) { } evals;
in
{
inherit importedModuleWithInstances grouped;
inherit evals;
inherit evals allMachines;
}