nix: specify PGUSER (#25546)

sg adds a default PGUSER=sourcegraph. However, our auto database support
in nix uses the current user since it is via a unix socket.
This commit is contained in:
Keegan Carruthers-Smith 2021-09-30 13:23:43 +02:00 committed by GitHub
parent 269df705d9
commit 31e0e1f5b4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -11,6 +11,7 @@ export PGHOST="${SG_DATA_DIR:-$HOME/.sourcegraph}/postgres"
export PGDATA="${PGHOST}/${PGVER}"
export PGDATABASE=postgres
export PGDATASOURCE="postgresql:///postgres?host=${PGHOST}"
export PGUSER="${USER}"
if [ ! -d "$PGHOST" ]; then
mkdir -p "$PGHOST"