nixos/roles/postgres.nix
2024-12-18 18:19:37 -06:00

21 lines
567 B
Nix

{ pkgs, ... }:
{
services.postgresql = {
enable = true;
identMap = ''
# ArbitraryMapName systemUser DBUser
superuser_map root postgres
superuser_map postgres postgres
# Let other names login as themselves
superuser_map /^(.*)$ \1
'';
authentication = pkgs.lib.mkOverride 10 ''
local all postgres peer map=superuser_map
local sameuser all trust
host all all 127.0.0.1/32 trust
host all all ::1/128 trust
'';
};
}