From ccf0c5fee5ed204be1634f764b77799af8387baf Mon Sep 17 00:00:00 2001 From: RGBCube Date: Tue, 30 Apr 2024 12:56:07 +0300 Subject: [PATCH] Fix pg conf for real --- hosts/cube/postgresql.nix | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/hosts/cube/postgresql.nix b/hosts/cube/postgresql.nix index 0893ba0..935ad74 100644 --- a/hosts/cube/postgresql.nix +++ b/hosts/cube/postgresql.nix @@ -23,18 +23,17 @@ in systemConfiguration { services.postgresql = enabled { package = pkgs.postgresql_14; - initdbArgs = [ "--locale=C" "--encoding=UTF8" ]; + enableJIT = true; - authentication = mkOverride 10 '' - # Type Database DBUser Authentication IdentMap - local all all peer map=superuser_map + initdbArgs = [ "--locale=C" "--encoding=UTF8" ]; + initialScript = pkgs.writeText "grant-root-perms" '' + GRANT pg_read_all_data TO root; + GRANT pg_write_all_data TO root; ''; - identMap = '' - # Map System DBUser - superuser_map root ^(.*)$ - superuser_map postgres ^(.*)$ - superuser_map /^(.*)$ \1 + authentication = mkOverride 10 '' + # Type Database DBUser Authentication + local all all peer ''; ensureUsers = [