From e7c92d034d5a8fa2cddb523148a168d944f49f4a Mon Sep 17 00:00:00 2001 From: Johannes Kirschbauer Date: Sun, 15 Sep 2024 18:06:26 +0200 Subject: [PATCH] fixup! Inventory: add machines automatically from machines dir --- lib/build-clan/module.nix | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/build-clan/module.nix b/lib/build-clan/module.nix index 22b154a3b..b05dfdc85 100644 --- a/lib/build-clan/module.nix +++ b/lib/build-clan/module.nix @@ -223,6 +223,14 @@ in imports = [ # Merge the inventory file { 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 { inventory.meta = if config.meta != null then config.meta else { }; } ];