23 lines
456 B
Nix
23 lines
456 B
Nix
|
{ lib, config, ... }:
|
||
|
|
||
|
{
|
||
|
options = let
|
||
|
inherit (lib) mkOption types;
|
||
|
in {
|
||
|
my.secrets.apps = mkOption {
|
||
|
default = {};
|
||
|
type = with types; attrsOf attrs;
|
||
|
};
|
||
|
};
|
||
|
|
||
|
config = let
|
||
|
inherit (lib) nameValuePair mapAttrs';
|
||
|
in {
|
||
|
resource.vault_generic_secret = mapAttrs' (name: value: nameValuePair "apps_${name}" {
|
||
|
path = "kv/apps/${name}";
|
||
|
|
||
|
data_json = builtins.toJSON value;
|
||
|
}) config.my.secrets.apps;
|
||
|
};
|
||
|
}
|