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", []) decls = option.get("declarations", [])
source_path, name = replace_store_path(decls[0]) if decls:
print(source_path, name) source_path, name = replace_store_path(decls[0])
res += f""" print(source_path, name)
res += f"""
:simple-git: [{name}]({source_path}) :simple-git: [{name}]({source_path})
""" """
res += "\n" res += "\n"
return res return res

View File

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

View File

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