#!/nix/store/izpf49b74i15pcr9708s3xdwyqs4jxwl-bash-5.2p32/bin/bash
set -e
if ! test -e /var/lib/postgresql/15/PG_VERSION; then
  # Cleanup the data directory.
  rm -f /var/lib/postgresql/15/*.conf

  # Initialise the database.
  initdb -U postgres 

  # See postStart!
  touch "/var/lib/postgresql/15/.first_startup"
fi

ln -sfn "/nix/store/7m0ncyx18qs698h71vffsiajrl70dx5c-postgresql.conf/postgresql.conf" "/var/lib/postgresql/15/postgresql.conf"



