Skip to content

Commit af2f531

Browse files
committed
fix: conn rules
1 parent ce0ef9b commit af2f531

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

nix/ext/tests/pgjwt.nix

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,16 +57,35 @@ self.inputs.nixpkgs.lib.nixos.runTest {
5757
services.postgresql = {
5858
enable = true;
5959
package = psql_15;
60+
enableTCPIP = true;
61+
authentication = ''
62+
local all postgres peer map=postgres
63+
local all all peer map=root
64+
'';
65+
identMap = ''
66+
root root supabase_admin
67+
postgres postgres postgres
68+
'';
69+
ensureUsers = [
70+
{
71+
name = "supabase_admin";
72+
ensureClauses.superuser = true;
73+
}
74+
];
6075
# pg_regress test for pgjwt rely on the "extensions" schema to be present
6176
initialScript = pkgs.writeText "init-postgres-with-schema" ''
6277
CREATE SCHEMA IF NOT EXISTS extensions;
6378
CREATE EXTENSION IF NOT EXISTS pgcrypto WITH SCHEMA extensions;
6479
'';
80+
settings = (installedExtension "15").defaultSettings or { };
6581
};
6682

83+
networking.firewall.allowedTCPPorts = [ config.services.postgresql.settings.port ];
84+
6785
specialisation.postgresql17.configuration = {
6886
services.postgresql = {
6987
package = lib.mkForce psql_17;
88+
settings = (installedExtension "17").defaultSettings or { };
7089
};
7190

7291
systemd.services.postgresql-migrate = {

0 commit comments

Comments
 (0)