This PR makes it possible to install Postgres Extensions with Devbox. This didn't work with previous versions of Devbox + the Postgres plugin because:
Postgres was only looking for extensions within a subdirectory of the Postgres package in the Nix Store. Unless we install the extensions using the
The default PostgreSQL output out doesn't include libraries used to install some extensions.
Fortunately, the Nix PostgreSQL package is patched so that you can set the pkglibdir at runtime using the NIX_PGLIBDIR environment variable. If we set this variable to $DEVBOX_PACKAGES_DIR/lib, and if the user installs the lib output, extensions should work as expected.
This PR sets the NIX_PGLIBDIR variable in the plugin, and adds documentation + modifies the example to highlight how to install postgres with the lib output.
How was it tested?
Tested on our Postgres example with the PostGIS extension.
Summary
This PR makes it possible to install Postgres Extensions with Devbox. This didn't work with previous versions of Devbox + the Postgres plugin because:
out
doesn't include libraries used to install some extensions.Fortunately, the Nix PostgreSQL package is patched so that you can set the pkglibdir at runtime using the
NIX_PGLIBDIR
environment variable. If we set this variable to$DEVBOX_PACKAGES_DIR/lib
, and if the user installs thelib
output, extensions should work as expected.This PR sets the NIX_PGLIBDIR variable in the plugin, and adds documentation + modifies the example to highlight how to install postgres with the lib output.
How was it tested?
Tested on our Postgres example with the PostGIS extension.