@@ -49,6 +49,8 @@ PGBINOLD="/usr/lib/postgresql/bin"
49
49
PGLIBOLD=" /usr/lib/postgresql/lib"
50
50
51
51
PG_UPGRADE_BIN_DIR=" /tmp/pg_upgrade_bin/$PGVERSION "
52
+ NIX_INSTALLER_PATH=" /tmp/persistent/nix-installer"
53
+ NIX_INSTALLER_PACKAGE_PATH=" $NIX_INSTALLER_PATH .tar.gz"
52
54
53
55
if [ -L " $PGBINOLD /pg_upgrade" ]; then
54
56
BINARY_PATH=$( readlink -f " $PGBINOLD /pg_upgrade" )
@@ -286,9 +288,18 @@ function initiate_upgrade {
286
288
if ! command -v nix > /dev/null; then
287
289
echo " 1.1. Nix is not installed; installing."
288
290
289
- curl --proto ' =https' --tlsv1.2 -sSf -L https://install.determinate.systems/nix | sh -s -- install --no-confirm \
290
- --extra-conf " substituters = https://cache.nixos.org https://nix-postgres-artifacts.s3.amazonaws.com" \
291
- --extra-conf " trusted-public-keys = nix-postgres-artifacts:dGZlQOvKcNEjvT7QEAJbcV6b6uk7VF/hWMjhYleiaLI=% cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY="
291
+ if [ -f " $NIX_INSTALLER_PACKAGE_PATH " ]; then
292
+ echo " 1.1.1. Installing Nix using the provided installer"
293
+ tar -xzf " $NIX_INSTALLER_PACKAGE_PATH " -C /tmp/persistent/
294
+ chmod +x " $NIX_INSTALLER_PATH "
295
+ " $NIX_INSTALLER_PATH " install --no-confirm
296
+ else
297
+ echo " 1.1.1. Installing Nix using the official installer"
298
+
299
+ curl --proto ' =https' --tlsv1.2 -sSf -L https://install.determinate.systems/nix | sh -s -- install --no-confirm \
300
+ --extra-conf " substituters = https://cache.nixos.org https://nix-postgres-artifacts.s3.amazonaws.com" \
301
+ --extra-conf " trusted-public-keys = nix-postgres-artifacts:dGZlQOvKcNEjvT7QEAJbcV6b6uk7VF/hWMjhYleiaLI=% cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY="
302
+ fi
292
303
else
293
304
echo " 1.1. Nix is installed; moving on."
294
305
fi
0 commit comments