Also begin adding rust building capabilities to be able to write rust binaries for some commands.
52 lines
1.4 KiB
Nix
52 lines
1.4 KiB
Nix
{ khscodesLib, ... }:
|
|
{ lib, config, ... }:
|
|
let
|
|
cfg = config.khscodes.openbao;
|
|
in
|
|
{
|
|
options.khscodes.openbao = {
|
|
vault_mount = lib.mkOption {
|
|
type = lib.types.attrsOf (
|
|
khscodesLib.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";
|
|
}
|
|
);
|
|
};
|
|
};
|
|
config = lib.mkIf cfg.enable {
|
|
provider.vault = {
|
|
address = "https://auth.kaareskovgaard.net";
|
|
};
|
|
terraform.required_providers.vault = {
|
|
source = "hashicorp/vault";
|
|
version = "5.0.0";
|
|
};
|
|
resource.vault_mount = lib.mapAttrs' (
|
|
name: value: {
|
|
name = khscodesLib.sanitize-terraform-name name;
|
|
value = value;
|
|
}
|
|
);
|
|
};
|
|
}
|