WIP: clan-cli interactive secrets
Some checks failed
checks / check-links (pull_request) Successful in 22s
checks / checks (pull_request) Failing after 2m43s
checks / checks-impure (pull_request) Failing after 11m0s

This commit is contained in:
lassulus 2024-03-01 10:25:39 +01:00
parent 1827e8ed2a
commit d4f9486022

View File

@ -92,14 +92,42 @@
config' = config;
in
lib.mkOption {
type = lib.types.attrsOf (lib.types.submodule ({ config, ... }: {
type = lib.types.attrsOf (lib.types.submodule ({ config, name, ... }: {
options = {
name = lib.mkOption {
type = lib.types.str;
description = ''
name of the secret
'';
default = config._module.args.name;
default = name;
};
interactive = lib.mkOption {
type = lib.types.submodule ({ config, ... }: {
options = {
path = lib.mkOption {
type = lib.types.listOf (lib.types.either lib.types.path lib.types.package);
default = [ ];
description = ''
Extra paths to add to the PATH environment variable when running the generator.
'';
};
script = lib.mkOption {
type = lib.types.nullOr lib.types.str;
default = null;
description = ''
If this script is set, the secret generator will show the prompt generated by this script
and pass the result to post.
'';
};
post = lib.mkOption {
type = lib.types.str;
default = "cat";
description = ''
this script takes the output of script as the input and the output is saved to the secret.
'';
};
};
});
};
path = lib.mkOption {
type = lib.types.str;
@ -133,6 +161,34 @@
'';
default = fact.config._module.args.name;
};
interactive = lib.mkOption {
type = lib.types.submodule ({ config, ... }: {
options = {
path = lib.mkOption {
type = lib.types.listOf (lib.types.either lib.types.path lib.types.package);
default = [ ];
description = ''
Extra paths to add to the PATH environment variable when running the generator.
'';
};
script = lib.mkOption {
type = lib.types.nullOr lib.types.str;
default = null;
description = ''
If this script is set, the secret generator will show the prompt generated by this script
and pass the result to post.
'';
};
post = lib.mkOption {
type = lib.types.str;
default = "cat";
description = ''
this script takes the output of script as the input and the output is saved to the secret.
'';
};
};
});
};
path = lib.mkOption {
type = lib.types.str;
description = ''