Move postgres host and port to a single location. #1205
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
These are some minor changes I did when I started development work on #1204. I'm not on NixOS and did most development in a NixOS docker container. Following the steps to bring up the development environment in a Docker container didn't work at first, Postgres doesn't allow running as root, and the NixOS docker image user is root. So in the end I ended up using a second container to run the Postgres server and then pointed the hydra instance running in the NixOS docker container at the external database. This did allow me to easily load a copy of the production database, so in the end it was actually quite convenient for development.
The postgres command line utilities respect the
PGPORT
andPGHOST
environment variables, so we don't need to specify them manually in various files. Putting them in the environment allows overriding them manually when using a different postgres server.The
LOGNAME
variable is new, but it appeared to be necessary for the queue runner to come up.This also switches communication to the database during initialisation of the development environment to use tcp instead of a unix domain socket.
I have not tested these changes on a 'real' instance NixOS, only in a NixOS docker container (where Postgres doesn't start), the environment variables looked good inside the nix shell.
fyi @mikepurvis.