From 821264fe2ee7bd4e6032e7875632946688d3d39f Mon Sep 17 00:00:00 2001 From: Johannes Kirschbauer Date: Tue, 8 Apr 2025 15:55:03 +0200 Subject: [PATCH] fix(getModulesSchema): forward argument to evalClanModules --- lib/inventory/frontmatter/default.nix | 21 ++++++++++++++++----- lib/inventory/schemas/default.nix | 6 +++++- 2 files changed, 21 insertions(+), 6 deletions(-) diff --git a/lib/inventory/frontmatter/default.nix b/lib/inventory/frontmatter/default.nix index 1beeb21ac..fee0e29ed 100644 --- a/lib/inventory/frontmatter/default.nix +++ b/lib/inventory/frontmatter/default.nix @@ -9,11 +9,22 @@ let }; getModulesSchema = - modules: - lib.mapAttrs ( - _moduleName: rolesOptions: - lib.mapAttrs (_roleName: options: jsonWithoutHeader.parseOptions options { }) rolesOptions - ) (clanLib.evalClan.evalClanModulesWithRoles modules); + { + modules, + clan-core, + pkgs, + }: + lib.mapAttrs + ( + _moduleName: rolesOptions: + lib.mapAttrs (_roleName: options: jsonWithoutHeader.parseOptions options { }) rolesOptions + ) + ( + clanLib.evalClan.evalClanModulesWithRoles { + allModules = modules; + inherit pkgs clan-core; + } + ); evalFrontmatter = { diff --git a/lib/inventory/schemas/default.nix b/lib/inventory/schemas/default.nix index f6a6660a1..4ebde390e 100644 --- a/lib/inventory/schemas/default.nix +++ b/lib/inventory/schemas/default.nix @@ -6,7 +6,11 @@ }: let - modulesSchema = self.lib.modules.getModulesSchema self.clanModules; + modulesSchema = self.lib.modules.getModulesSchema { + modules = self.clanModules; + inherit pkgs; + clan-core = self; + }; jsonLib = self.lib.jsonschema { inherit includeDefaults; }; includeDefaults = true;