2024-08-10 03:51:53 +03:00
|
|
|
{ config, ... }:
|
2022-08-05 00:57:54 +03:00
|
|
|
|
|
|
|
{
|
2024-08-10 03:51:53 +03:00
|
|
|
imports = [
|
|
|
|
./options.nix
|
|
|
|
./incandescence.nix
|
2024-08-14 03:59:33 +03:00
|
|
|
./simulacrum/test-data.nix
|
2024-08-10 03:51:53 +03:00
|
|
|
];
|
|
|
|
|
2023-03-05 21:51:20 +02:00
|
|
|
links = {
|
2022-08-05 00:57:54 +03:00
|
|
|
patroni-pg-internal.ipv4 = "0.0.0.0";
|
|
|
|
patroni-api.ipv4 = "0.0.0.0";
|
|
|
|
patroni-pg-access.ipv4 = "127.0.0.1";
|
|
|
|
};
|
|
|
|
services.patroni = {
|
|
|
|
nodes = {
|
2023-12-01 01:20:28 +02:00
|
|
|
worker = [ "grail" "thunderskin" "VEGAS" ];
|
2024-08-02 23:46:27 +03:00
|
|
|
haproxy = [ "checkmate" "grail" "VEGAS" "prophet" ];
|
2022-08-05 00:57:54 +03:00
|
|
|
};
|
|
|
|
nixos = {
|
2023-06-02 00:18:22 +03:00
|
|
|
worker = [
|
|
|
|
./worker.nix
|
|
|
|
./metrics.nix
|
2024-08-10 03:51:53 +03:00
|
|
|
./create-databases.nix
|
2023-06-02 00:18:22 +03:00
|
|
|
];
|
2022-08-05 00:57:54 +03:00
|
|
|
haproxy = ./haproxy.nix;
|
|
|
|
};
|
2024-07-08 21:19:45 +03:00
|
|
|
secrets = let
|
|
|
|
inherit (config.services.patroni) nodes;
|
|
|
|
default = {
|
|
|
|
nodes = nodes.worker;
|
|
|
|
owner = "patroni";
|
|
|
|
};
|
|
|
|
in {
|
|
|
|
PATRONI_REPLICATION_PASSWORD = default;
|
|
|
|
PATRONI_SUPERUSER_PASSWORD = default;
|
|
|
|
PATRONI_REWIND_PASSWORD = default;
|
|
|
|
metricsCredentials.nodes = nodes.worker;
|
|
|
|
};
|
2024-08-14 03:59:33 +03:00
|
|
|
simulacrum = {
|
|
|
|
enable = true;
|
|
|
|
deps = [ "consul" "incandescence" "locksmith" ];
|
|
|
|
settings = ./simulacrum/test.nix;
|
|
|
|
};
|
2022-08-05 00:57:54 +03:00
|
|
|
};
|
|
|
|
}
|