diff --git a/doc/hooks/postgresql-test-hook.section.md b/doc/hooks/postgresql-test-hook.section.md index 8b37ca1e4b3e..59d7f7a644c9 100644 --- a/doc/hooks/postgresql-test-hook.section.md +++ b/doc/hooks/postgresql-test-hook.section.md @@ -45,6 +45,7 @@ Bash-only variables: - `postgresqlTestSetupCommands`: bash commands to run after database start, defaults to running `$postgresqlTestSetupSQL` as database administrator. - `postgresqlEnableTCP`: set to `1` to enable TCP listening. Flaky; not recommended. - `postgresqlStartCommands`: defaults to `pg_ctl start`. + - `postgresqlExtraSettings`: Additional configuration to add to `postgresql.conf` ## Hooks {#sec-postgresqlTestHook-hooks} diff --git a/pkgs/build-support/setup-hooks/postgresql-test-hook/postgresql-test-hook.sh b/pkgs/build-support/setup-hooks/postgresql-test-hook/postgresql-test-hook.sh index 3eec67d60feb..d09153b2d644 100644 --- a/pkgs/build-support/setup-hooks/postgresql-test-hook/postgresql-test-hook.sh +++ b/pkgs/build-support/setup-hooks/postgresql-test-hook/postgresql-test-hook.sh @@ -56,6 +56,8 @@ EOF echo 'initializing postgresql' initdb -U postgres + echo "$postgresqlExtraSettings" >>"$PGDATA/postgresql.conf" + # Move the socket echo "unix_socket_directories = '$NIX_BUILD_TOP/run/postgresql'" >>"$PGDATA/postgresql.conf"