schema: update clan option source
This commit is contained in:
@@ -34,6 +34,7 @@
|
||||
Public attributes of buildClan. As specified in publicAttrs.
|
||||
*/
|
||||
buildClanWith =
|
||||
|
||||
{
|
||||
clan-core,
|
||||
# TODO: Below should be module options such that the user can override them?
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
{
|
||||
self,
|
||||
self',
|
||||
lib,
|
||||
pkgs,
|
||||
flakeOptions,
|
||||
...
|
||||
@@ -23,7 +24,19 @@ let
|
||||
_module.args = { inherit (self) clanLib; };
|
||||
});
|
||||
|
||||
clanSchema = jsonLib.parseOptions (flakeOptions.clan.type.getSubOptions [ "clan" ]) { };
|
||||
opts = (flakeOptions.flake.type.getSubOptions [ "flake" ]);
|
||||
clanOpts = opts.clan.type.getSubOptions [ "clan" ];
|
||||
include = [
|
||||
"directory"
|
||||
"inventory"
|
||||
"machines"
|
||||
"meta"
|
||||
"modules"
|
||||
"outputs"
|
||||
"secrets"
|
||||
"templates"
|
||||
];
|
||||
clanSchema = jsonLib.parseOptions (lib.filterAttrs (n: _v: lib.elem n include) clanOpts) { };
|
||||
|
||||
renderSchema = pkgs.writers.writePython3Bin "render-schema" {
|
||||
flakeIgnore = [
|
||||
|
||||
@@ -187,8 +187,6 @@ ClanMetaType = Unknown
|
||||
ClanModulesType = dict[str, dict[str, Any] | list[Any] | bool | float | int | str | None]
|
||||
ClanOutputsType = Output
|
||||
ClanSecretsType = Secret
|
||||
ClanSelfType = dict[str, Any] | list[Any] | bool | float | int | str
|
||||
ClanSpecialargsType = dict[str, dict[str, Any] | list[Any] | bool | float | int | str | None]
|
||||
ClanTemplatesType = Template
|
||||
|
||||
class Clan(TypedDict):
|
||||
@@ -199,6 +197,4 @@ class Clan(TypedDict):
|
||||
modules: NotRequired[ClanModulesType]
|
||||
outputs: NotRequired[ClanOutputsType]
|
||||
secrets: NotRequired[ClanSecretsType]
|
||||
self: NotRequired[ClanSelfType]
|
||||
specialArgs: NotRequired[ClanSpecialargsType]
|
||||
templates: NotRequired[ClanTemplatesType]
|
||||
|
||||
Reference in New Issue
Block a user