Ext/modules: expose module schemas
This commit is contained in:
@@ -1,8 +1,20 @@
|
||||
{ lib }:
|
||||
{ lib, self }:
|
||||
let
|
||||
# Trim the .nix extension from a filename
|
||||
trimExtension = name: builtins.substring 0 (builtins.stringLength name - 4) name;
|
||||
|
||||
jsonWithoutHeader = self.lib.jsonschema {
|
||||
includeDefaults = true;
|
||||
header = { };
|
||||
};
|
||||
|
||||
getModulesSchema =
|
||||
modules:
|
||||
lib.mapAttrs (
|
||||
_moduleName: rolesOptions:
|
||||
lib.mapAttrs (_roleName: options: jsonWithoutHeader.parseOptions options { }) rolesOptions
|
||||
) (self.lib.evalClanModulesWithRoles modules);
|
||||
|
||||
evalFrontmatter =
|
||||
{
|
||||
moduleName,
|
||||
@@ -90,7 +102,7 @@ in
|
||||
{
|
||||
inherit
|
||||
frontmatterOptions
|
||||
|
||||
getModulesSchema
|
||||
getFrontmatter
|
||||
|
||||
checkConstraints
|
||||
|
||||
Reference in New Issue
Block a user