Ext/modules: expose module schemas

This commit is contained in:
Johannes Kirschbauer
2024-11-21 16:41:25 +01:00
parent 0fcaf7372b
commit 3ebda7c304
5 changed files with 31 additions and 14 deletions

View File

@@ -6,21 +6,17 @@
...
}:
let
includeDefaults = true;
# { mName :: { roleName :: Options } }
modulesRolesOptions = self.lib.evalClanModulesWithRoles self.clanModules;
modulesSchema = lib.mapAttrs (
_moduleName: rolesOptions:
lib.mapAttrs (_roleName: options: jsonWithoutHeader.parseOptions options { }) rolesOptions
) modulesRolesOptions;
# getModulesSchema = modules: lib.mapAttrs (
# _moduleName: rolesOptions:
# lib.mapAttrs (_roleName: options: jsonWithoutHeader.parseOptions options { }) rolesOptions
# ) (self.lib.evalClanModulesWithRoles modules);
modulesSchema = self.lib.modules.getModulesSchema self.clanModules;
jsonLib = self.lib.jsonschema { inherit includeDefaults; };
jsonWithoutHeader = self.lib.jsonschema {
inherit includeDefaults;
header = { };
};
includeDefaults = true;
frontMatterSchema = jsonLib.parseOptions self.lib.modules.frontmatterOptions { };
@@ -53,6 +49,7 @@ in
frontMatterSchema
inventorySchema
modulesSchema
getModulesSchema
renderSchema
inventory-schema-abstract
;