2024-08-10 03:51:53 +03:00
|
|
|
{ lib, ... }:
|
|
|
|
|
|
|
|
let
|
|
|
|
inherit (lib) mkOption;
|
|
|
|
inherit (lib.types) attrsOf enum listOf submodule str;
|
|
|
|
in
|
|
|
|
|
|
|
|
{
|
|
|
|
options.patroni = {
|
|
|
|
databases = mkOption {
|
|
|
|
type = attrsOf (submodule ({ name, ... }: {
|
|
|
|
options = {
|
|
|
|
owner = mkOption {
|
|
|
|
type = str;
|
|
|
|
default = name;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}));
|
|
|
|
};
|
|
|
|
users = mkOption {
|
|
|
|
type = attrsOf (submodule ({ ... }: {
|
|
|
|
options = {
|
|
|
|
locksmith = {
|
|
|
|
nodes = mkOption {
|
|
|
|
type = listOf str;
|
|
|
|
default = [];
|
|
|
|
};
|
|
|
|
format = mkOption {
|
2024-08-11 21:47:19 +03:00
|
|
|
type = enum [ "pgpass" "envFile" "raw" ];
|
2024-08-10 03:51:53 +03:00
|
|
|
default = "pgpass";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}));
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|