Merge pull request 'vars: add display attribute submodule for customisable ux' (#4559) from vars-display into main
Reviewed-on: https://git.clan.lol/clan/clan-core/pulls/4559 Reviewed-by: DavHau <d.hauer.it@gmail.com>
This commit is contained in:
@@ -88,6 +88,14 @@
|
|||||||
files.user-password.deploy = false;
|
files.user-password.deploy = false;
|
||||||
|
|
||||||
prompts.user-password = lib.mkIf settings.prompt {
|
prompts.user-password = lib.mkIf settings.prompt {
|
||||||
|
display = {
|
||||||
|
group = settings.user;
|
||||||
|
label = "password";
|
||||||
|
required = false;
|
||||||
|
helperText = ''
|
||||||
|
Your password will be encrypted and stored securely using the secret store you've configured.
|
||||||
|
'';
|
||||||
|
};
|
||||||
type = "hidden";
|
type = "hidden";
|
||||||
persist = true;
|
persist = true;
|
||||||
description = "You can autogenerate a password, if you leave this prompt blank.";
|
description = "You can autogenerate a password, if you leave this prompt blank.";
|
||||||
|
|||||||
@@ -43,6 +43,43 @@ let
|
|||||||
{ config._module.args.pkgs = pkgs; }
|
{ config._module.args.pkgs = pkgs; }
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
# Display module for prompts
|
||||||
|
displayModule = {
|
||||||
|
options = {
|
||||||
|
display.group = mkOption {
|
||||||
|
type = nullOr str;
|
||||||
|
description = ''
|
||||||
|
The group to display the prompt in.
|
||||||
|
This is useful to group prompts together.
|
||||||
|
'';
|
||||||
|
default = null;
|
||||||
|
};
|
||||||
|
display.label = mkOption {
|
||||||
|
type = nullOr str;
|
||||||
|
description = ''
|
||||||
|
The label to display for the prompt.
|
||||||
|
If not set, the name of the prompt will be used.
|
||||||
|
'';
|
||||||
|
default = null;
|
||||||
|
};
|
||||||
|
display.required = mkOption {
|
||||||
|
type = bool;
|
||||||
|
description = ''
|
||||||
|
Whether the prompt is required.
|
||||||
|
If set to false, the user will be able to continue without providing a value.
|
||||||
|
'';
|
||||||
|
default = true;
|
||||||
|
};
|
||||||
|
display.helperText = mkOption {
|
||||||
|
type = nullOr str;
|
||||||
|
description = ''
|
||||||
|
Additional text to display next to the prompt.
|
||||||
|
This can be used to provide additional information about the prompt.
|
||||||
|
'';
|
||||||
|
default = null;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
options = {
|
options = {
|
||||||
@@ -303,6 +340,7 @@ in
|
|||||||
default = { };
|
default = { };
|
||||||
type = attrsOf (
|
type = attrsOf (
|
||||||
submodule (prompt: {
|
submodule (prompt: {
|
||||||
|
imports = [ displayModule ];
|
||||||
options = {
|
options = {
|
||||||
name = mkOption {
|
name = mkOption {
|
||||||
description = ''
|
description = ''
|
||||||
|
|||||||
Reference in New Issue
Block a user