44 lines
1.2 KiB
Nix
44 lines
1.2 KiB
Nix
{ lib, config, ... }:
|
|
let
|
|
cfg = config.khscodes.vault;
|
|
in
|
|
{
|
|
options.khscodes.vault = {
|
|
mount = lib.mkOption {
|
|
type = lib.types.attrsOf (
|
|
lib.khscodes.mkSubmodule {
|
|
options = {
|
|
type = lib.mkOption {
|
|
type = lib.types.str;
|
|
description = "Type of mount";
|
|
};
|
|
path = lib.mkOption {
|
|
type = lib.types.str;
|
|
description = "Path of the mount";
|
|
default = null;
|
|
};
|
|
default_lease_ttl_seconds = lib.mkOption {
|
|
type = lib.types.int;
|
|
description = "Default lease ttl in seconds";
|
|
default = null;
|
|
};
|
|
max_lease_ttl_seconds = lib.mkOption {
|
|
type = lib.types.int;
|
|
description = "Max lease ttl in seconds";
|
|
default = null;
|
|
};
|
|
};
|
|
description = "vault_mount";
|
|
}
|
|
);
|
|
description = "Defines a vault mount";
|
|
default = { };
|
|
};
|
|
};
|
|
config = lib.mkIf cfg.enable {
|
|
resource.vault_mount = lib.mapAttrs' (name: value: {
|
|
name = lib.khscodes.sanitize-terraform-name name;
|
|
value = value;
|
|
}) cfg.mount;
|
|
};
|
|
}
|