vars: add name to generators
This commit is contained in:
@@ -40,6 +40,7 @@ in
|
||||
generators = lib.flip lib.mapAttrs config.clan.core.vars.generators (
|
||||
_name: generator: {
|
||||
inherit (generator)
|
||||
name
|
||||
dependencies
|
||||
finalScript
|
||||
invalidationHash
|
||||
@@ -49,7 +50,7 @@ in
|
||||
;
|
||||
files = lib.flip lib.mapAttrs generator.files (
|
||||
_name: file: {
|
||||
inherit (file) deploy secret;
|
||||
inherit (file) name deploy secret;
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
@@ -46,6 +46,16 @@ in
|
||||
submodule (generator: {
|
||||
imports = [ ./generator.nix ];
|
||||
options = {
|
||||
name = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
description = ''
|
||||
The name of the generator.
|
||||
This name will be used to refer to the generator in other generators.
|
||||
'';
|
||||
readOnly = true;
|
||||
default = generator.config._module.args.name;
|
||||
};
|
||||
|
||||
dependencies = lib.mkOption {
|
||||
description = ''
|
||||
A list of other generators that this generator depends on.
|
||||
@@ -212,6 +222,14 @@ in
|
||||
type = attrsOf (
|
||||
submodule (prompt: {
|
||||
options = {
|
||||
name = lib.mkOption {
|
||||
description = ''
|
||||
The name of the prompt.
|
||||
This name will be used to refer to the prompt in the generator script.
|
||||
'';
|
||||
type = str;
|
||||
default = prompt.config._module.args.name;
|
||||
};
|
||||
createFile = lib.mkOption {
|
||||
description = ''
|
||||
Whether the prompted value should be stored in a file with the same name as the prompt.
|
||||
|
||||
Reference in New Issue
Block a user