Merge pull request 'Feat(inventory): simplify instance module spec, by applying a default' (#4054) from hsjobeki/module-default into main
Reviewed-on: https://git.clan.lol/clan/clan-core/pulls/4054
This commit is contained in:
@@ -373,7 +373,11 @@ in
|
||||
instances = lib.mkOption {
|
||||
description = "Multi host service module instances";
|
||||
type = types.attrsOf (
|
||||
types.submodule {
|
||||
types.submoduleWith {
|
||||
modules = [
|
||||
(
|
||||
{ name, ... }:
|
||||
{
|
||||
options = {
|
||||
# ModuleSpec
|
||||
module = lib.mkOption {
|
||||
@@ -388,8 +392,10 @@ in
|
||||
};
|
||||
options.name = lib.mkOption {
|
||||
type = types.str;
|
||||
default = name;
|
||||
};
|
||||
};
|
||||
default = { };
|
||||
};
|
||||
roles = lib.mkOption {
|
||||
default = { };
|
||||
@@ -465,6 +471,9 @@ in
|
||||
};
|
||||
};
|
||||
}
|
||||
)
|
||||
];
|
||||
}
|
||||
);
|
||||
default = { };
|
||||
};
|
||||
|
||||
@@ -15,12 +15,12 @@ class Unknown:
|
||||
pass
|
||||
|
||||
|
||||
InventoryInstanceModuleNameType = str
|
||||
InventoryInstanceModuleInputType = str
|
||||
InventoryInstanceModuleNameType = str
|
||||
|
||||
class InventoryInstanceModule(TypedDict):
|
||||
name: str
|
||||
input: NotRequired[InventoryInstanceModuleInputType]
|
||||
name: NotRequired[InventoryInstanceModuleNameType]
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user