mirror of
https://github.com/Mic92/sops-nix.git
synced 2025-12-26 14:14:58 +08:00
Emit plain file when key is empty
Co-Authored-By: Slaier <slaier@users.noreply.github.com>
This commit is contained in:
parent
aa5caa129b
commit
f21c31dadf
4 changed files with 83 additions and 11 deletions
|
|
@ -15,11 +15,12 @@ let
|
|||
|
||||
key = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
default = name;
|
||||
default = if cfg.defaultSopsKey != null then cfg.defaultSopsKey else name;
|
||||
description = ''
|
||||
Key used to lookup in the sops file.
|
||||
No tested data structures are supported right now.
|
||||
This option is ignored if format is binary.
|
||||
"" means whole file.
|
||||
'';
|
||||
};
|
||||
|
||||
|
|
@ -131,6 +132,16 @@ in {
|
|||
'';
|
||||
};
|
||||
|
||||
defaultSopsKey = mkOption {
|
||||
type = lib.types.nullOr lib.types.str;
|
||||
default = null;
|
||||
description = ''
|
||||
Default key used to lookup in all secrets.
|
||||
This option is ignored if format is binary.
|
||||
"" means whole file.
|
||||
'';
|
||||
};
|
||||
|
||||
validateSopsFiles = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
default = true;
|
||||
|
|
|
|||
|
|
@ -41,11 +41,12 @@ let
|
|||
};
|
||||
key = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
default = config._module.args.name;
|
||||
default = if cfg.defaultSopsKey != null then cfg.defaultSopsKey else config._module.args.name;
|
||||
description = ''
|
||||
Key used to lookup in the sops file.
|
||||
No tested data structures are supported right now.
|
||||
This option is ignored if format is binary.
|
||||
"" means whole file.
|
||||
'';
|
||||
};
|
||||
path = lib.mkOption {
|
||||
|
|
@ -176,6 +177,16 @@ in {
|
|||
'';
|
||||
};
|
||||
|
||||
defaultSopsKey = lib.mkOption {
|
||||
type = lib.types.nullOr lib.types.str;
|
||||
default = null;
|
||||
description = ''
|
||||
Default key used to lookup in all secrets.
|
||||
This option is ignored if format is binary.
|
||||
"" means whole file.
|
||||
'';
|
||||
};
|
||||
|
||||
validateSopsFiles = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
default = true;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue