1 with import <nixpkgs> {};
3 buildInputs = [ postgresql_11 glibcLocales ];
6 export PGDATA=$PWD/postgres
7 export PGHOST=$PWD/postgres
9 export LOG_PATH=$PWD/postgres/LOG
10 export PGDATABASE=postgres
11 export DATABASE_URL="postgresql:///postgres?host=$PGDATA"
12 export LANG=en_US.UTF-8;
13 export LOCALE_ARCHIVE=${glibcLocales}/lib/locale/locale-archive;
15 echo 'Initializing postgresql database...'
16 initdb $PGDATA --auth=trust >/dev/null
17 pg_ctl start -w -l $LOG_PATH -o "-c synchronous_commit=off -c listen_addresses= -c unix_socket_directories=$PGDATA"