fix pg_hba template

This commit is contained in:
asyncnomi 2025-08-02 01:47:03 +02:00
parent 41a6ed984a
commit 43e7ecc060

View file

@ -34,7 +34,7 @@ in
superuser_map root postgres superuser_map root postgres
superuser_map postgres postgres superuser_map postgres postgres
''; '';
authentication = lib.mkOverride 10 (builtins.concatStringsSep "\n " (['' authentication = lib.mkForce (builtins.concatStringsSep "\n" ([''
#type database DBuser auth-method optional_ident_map #type database DBuser auth-method optional_ident_map
local all all peer map=superuser_map local all all peer map=superuser_map
''] '']
@ -42,9 +42,9 @@ in
(map (slaveName: let slaveNode = nodes.${slaveName}; in (map (slaveName: let slaveNode = nodes.${slaveName}; in
"host replication replication 172.19.${toString slaveNode.zone}.${toString slaveNode.id}/32 md5" "host replication replication 172.19.${toString slaveNode.zone}.${toString slaveNode.id}/32 md5"
) mapping.db.slaves) ) mapping.db.slaves)
++ lib.optionals (builtins.elem myName mapping.db.slaves) ['' ++ lib.optionals (builtins.elem myName mapping.db.slaves) [
host replication replication ${masterIP}/32 md5 "host replication replication ${masterIP}/32 md5"
''])); ]));
ensureUsers = [{ ensureUsers = [{
name = "replication"; name = "replication";
ensureClauses.replication = true; ensureClauses.replication = true;