1
0
forked from clan/clan-core

vars: import by default & fix option rendering

This commit is contained in:
DavHau 2024-07-02 18:42:55 +07:00
parent 129db95426
commit 0b565c40ad
3 changed files with 8 additions and 5 deletions

View File

@ -113,12 +113,13 @@ def render_option(name: str, option: dict[str, Any], level: int = 3) -> str:
"""
decls = option.get("declarations", [])
source_path, name = replace_store_path(decls[0])
print(source_path, name)
res += f"""
if decls:
source_path, name = replace_store_path(decls[0])
print(source_path, name)
res += f"""
:simple-git: [{name}]({source_path})
"""
res += "\n"
res += "\n"
return res

View File

@ -17,5 +17,6 @@
# Inventory
./inventory/interface.nix
./meta/interface.nix
./vars
];
}

View File

@ -12,6 +12,7 @@ let
str
submoduleWith
;
# the original types.submodule has strange behavior
submodule = module: submoduleWith { modules = [ module ]; };
options = lib.mapAttrs (_: mkOption);
subOptions = opts: submodule { options = options opts; };
@ -23,7 +24,7 @@ in
Settings for the generated variables.
'';
type = submodule {
freeFormType = anything;
freeformType = anything;
imports = [ ./settings.nix ];
};
};