forked from clan/clan-core
vars: import by default & fix option rendering
This commit is contained in:
parent
3eb445cd0e
commit
85a9d82132
@ -113,6 +113,7 @@ def render_option(name: str, option: dict[str, Any], level: int = 3) -> str:
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
decls = option.get("declarations", [])
|
decls = option.get("declarations", [])
|
||||||
|
if decls:
|
||||||
source_path, name = replace_store_path(decls[0])
|
source_path, name = replace_store_path(decls[0])
|
||||||
print(source_path, name)
|
print(source_path, name)
|
||||||
res += f"""
|
res += f"""
|
||||||
|
@ -17,5 +17,6 @@
|
|||||||
# Inventory
|
# Inventory
|
||||||
./inventory/interface.nix
|
./inventory/interface.nix
|
||||||
./meta/interface.nix
|
./meta/interface.nix
|
||||||
|
./vars
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
{ lib, ... }:
|
{ lib, ... }:
|
||||||
{
|
{
|
||||||
options.clan.core.vars = lib.mkOption {
|
options.clan.core.vars = lib.mkOption {
|
||||||
internal = true;
|
visible = false;
|
||||||
description = ''
|
description = ''
|
||||||
Generated Variables
|
Generated Variables
|
||||||
|
|
||||||
|
@ -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 ];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user