Add importable clan.modules and clan.template interfaces without implementation
This commit is contained in:
@@ -61,6 +61,24 @@ in
|
|||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
modules = lib.mkOption {
|
||||||
|
type = types.attrsOf (types.submodule { imports = [ ./modules/interface.nix ]; });
|
||||||
|
default = { };
|
||||||
|
description = ''
|
||||||
|
Experimental: In the future,
|
||||||
|
this will be the main way to define Clan modules.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
templates = lib.mkOption {
|
||||||
|
type = types.submodule { imports = [ ./templates/interface.nix ]; };
|
||||||
|
default = { };
|
||||||
|
description = ''
|
||||||
|
Experimental: In the future,
|
||||||
|
this will be the main way to define Clan templates.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
# Meta
|
# Meta
|
||||||
meta = lib.mkOption {
|
meta = lib.mkOption {
|
||||||
description = ''
|
description = ''
|
||||||
@@ -107,6 +125,10 @@ in
|
|||||||
# We don't specify the type here, for better performance.
|
# We don't specify the type here, for better performance.
|
||||||
inventory = lib.mkOption { type = lib.types.raw; };
|
inventory = lib.mkOption { type = lib.types.raw; };
|
||||||
inventoryValuesPrios = lib.mkOption { type = lib.types.raw; };
|
inventoryValuesPrios = lib.mkOption { type = lib.types.raw; };
|
||||||
|
# all exported clan templates from this clan
|
||||||
|
templates = lib.mkOption { type = lib.types.raw; };
|
||||||
|
# all exported clan modules from this clan
|
||||||
|
modules = lib.mkOption { type = lib.types.raw; };
|
||||||
# all inventory module schemas
|
# all inventory module schemas
|
||||||
moduleSchemas = lib.mkOption { type = lib.types.raw; };
|
moduleSchemas = lib.mkOption { type = lib.types.raw; };
|
||||||
inventoryFile = lib.mkOption { type = lib.types.raw; };
|
inventoryFile = lib.mkOption { type = lib.types.raw; };
|
||||||
|
|||||||
@@ -212,9 +212,11 @@ in
|
|||||||
builtins.removeAttrs (clan-core.lib.values.getPrios { options = inventory.options; })
|
builtins.removeAttrs (clan-core.lib.values.getPrios { options = inventory.options; })
|
||||||
# tags are freeformType which is not supported yet.
|
# tags are freeformType which is not supported yet.
|
||||||
[ "tags" ];
|
[ "tags" ];
|
||||||
|
|
||||||
|
modules = config.modules;
|
||||||
|
templates = config.templates;
|
||||||
inventory = config.inventory;
|
inventory = config.inventory;
|
||||||
meta = config.inventory.meta;
|
meta = config.inventory.meta;
|
||||||
|
|
||||||
source = "${clan-core}";
|
source = "${clan-core}";
|
||||||
|
|
||||||
# machine specifics
|
# machine specifics
|
||||||
|
|||||||
27
lib/build-clan/modules/interface.nix
Normal file
27
lib/build-clan/modules/interface.nix
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
{
|
||||||
|
lib,
|
||||||
|
name,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
let
|
||||||
|
types = lib.types;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
# clan.modules.<module-name>
|
||||||
|
options = {
|
||||||
|
path = lib.mkOption {
|
||||||
|
type = types.path;
|
||||||
|
description = ''
|
||||||
|
Holds the path to the clan module.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
name = lib.mkOption {
|
||||||
|
type = types.str;
|
||||||
|
default = name;
|
||||||
|
description = ''
|
||||||
|
The name of the module.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
27
lib/build-clan/templates/clan/interface.nix
Normal file
27
lib/build-clan/templates/clan/interface.nix
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
{
|
||||||
|
lib,
|
||||||
|
name,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
let
|
||||||
|
types = lib.types;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
# clan.templates.clan.<template-name>
|
||||||
|
options = {
|
||||||
|
path = lib.mkOption {
|
||||||
|
type = types.path;
|
||||||
|
description = ''
|
||||||
|
Holds the path to the clan template.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
name = lib.mkOption {
|
||||||
|
type = types.str;
|
||||||
|
default = name;
|
||||||
|
description = ''
|
||||||
|
The name of the template.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
27
lib/build-clan/templates/disko/interface.nix
Normal file
27
lib/build-clan/templates/disko/interface.nix
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
{
|
||||||
|
lib,
|
||||||
|
name,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
let
|
||||||
|
types = lib.types;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
# clan.templates.disko.<template-name>
|
||||||
|
options = {
|
||||||
|
path = lib.mkOption {
|
||||||
|
type = types.path;
|
||||||
|
description = ''
|
||||||
|
Holds the path to the clan template.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
name = lib.mkOption {
|
||||||
|
type = types.str;
|
||||||
|
default = name;
|
||||||
|
description = ''
|
||||||
|
The name of the template.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
28
lib/build-clan/templates/interface.nix
Normal file
28
lib/build-clan/templates/interface.nix
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
{
|
||||||
|
lib,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
let
|
||||||
|
types = lib.types;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
options = {
|
||||||
|
# clan.templates.disko
|
||||||
|
disko = lib.mkOption {
|
||||||
|
type = types.attrsOf (types.submodule { imports = [ ./disko/interface.nix ]; });
|
||||||
|
default = { };
|
||||||
|
description = ''
|
||||||
|
Holds different disko templates.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
# clan.templates.clan
|
||||||
|
clan = lib.mkOption {
|
||||||
|
type = types.attrsOf (types.submodule { imports = [ ./clan/interface.nix ]; });
|
||||||
|
default = { };
|
||||||
|
description = ''
|
||||||
|
Holds the different clan templates.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user