2024-07-21 00:52:16 +03:00
|
|
|
{ cluster, config, depot, ... }:
|
|
|
|
|
|
|
|
let
|
|
|
|
apiLink = cluster.config.hostLinks.${config.networking.hostName}.frangiclave-server;
|
|
|
|
clusterLink = cluster.config.hostLinks.${config.networking.hostName}.frangiclave-cluster;
|
|
|
|
in
|
2024-07-20 23:18:01 +03:00
|
|
|
|
|
|
|
{
|
|
|
|
services.vault = {
|
|
|
|
enable = true;
|
|
|
|
package = depot.packages.openbao;
|
2024-07-21 00:52:16 +03:00
|
|
|
address = apiLink.tuple;
|
|
|
|
extraConfig = /*hcl*/ ''
|
|
|
|
api_addr = "${apiLink.url}"
|
|
|
|
cluster_addr = "${clusterLink.url}"
|
|
|
|
'';
|
|
|
|
|
|
|
|
storageBackend = "raft";
|
|
|
|
storageConfig = /*hcl*/ ''
|
|
|
|
node_id = "x${builtins.hashString "sha256" "frangiclave-node-${config.networking.hostName}"}"
|
|
|
|
'';
|
2024-07-20 23:18:01 +03:00
|
|
|
};
|
|
|
|
}
|