1
0
forked from clan/clan-core

Merge pull request 'vars: import by default & fix option rendering' (#1690) from DavHau/clan-core:DavHau-dave into main

This commit is contained in:
clan-bot 2024-07-04 06:15:50 +00:00
commit 0a4abd0e46
4 changed files with 9 additions and 6 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

@ -1,7 +1,7 @@
{ lib, ... }:
{
options.clan.core.vars = lib.mkOption {
internal = true;
visible = false;
description = ''
Generated Variables

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 ];
};
};