fixup! Inventory: add machines automatically from machines dir

This commit is contained in:
Johannes Kirschbauer
2024-09-15 18:06:26 +02:00
committed by hsjobeki
parent 924fb8a620
commit 82c725a605

View File

@@ -223,6 +223,14 @@ in
imports = [ imports = [
# Merge the inventory file # Merge the inventory file
{ inventory = inventoryLoaded; } { inventory = inventoryLoaded; }
# TODO: Figure out why this causes infinite recursion
{
inventory.machines = lib.optionalAttrs (builtins.pathExists "${directory}/machines") (
builtins.mapAttrs (_n: _v: { }) (
(lib.filterAttrs (_: t: t == "directory") (builtins.readDir "${directory}/machines"))
)
);
}
# Merge the meta attributes from the buildClan function # Merge the meta attributes from the buildClan function
{ inventory.meta = if config.meta != null then config.meta else { }; } { inventory.meta = if config.meta != null then config.meta else { }; }
]; ];