vars: add name to generators

This commit is contained in:
Jörg Thalheim
2024-11-20 12:24:38 +01:00
parent 410856ce1a
commit cd2ea0d735
2 changed files with 20 additions and 1 deletions

View File

@@ -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.