@@ -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" )
@@ -283,9 +285,18 @@ function initiate_upgrade {
283
285
if ! command -v nix > /dev/null; then
284
286
echo " 1.1. Nix is not installed; installing."
285
287
286
- curl --proto ' =https' --tlsv1.2 -sSf -L https://install.determinate.systems/nix | sh -s -- install --no-confirm \
287
- --extra-conf " substituters = https://cache.nixos.org https://nix-postgres-artifacts.s3.amazonaws.com" \
288
- --extra-conf " trusted-public-keys = nix-postgres-artifacts:dGZlQOvKcNEjvT7QEAJbcV6b6uk7VF/hWMjhYleiaLI=% cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY="
288
+ if [ -f " $NIX_INSTALLER_PACKAGE_PATH " ]; then
289
+ echo " 1.1.1. Installing Nix using the provided installer"
290
+ tar -xzf " $NIX_INSTALLER_PACKAGE_PATH " -C /tmp/persistent/
291
+ chmod +x " $NIX_INSTALLER_PATH "
292
+ " $NIX_INSTALLER_PATH " install --no-confirm
293
+ else
294
+ echo " 1.1.1. Installing Nix using the official installer"
295
+
296
+ curl --proto ' =https' --tlsv1.2 -sSf -L https://install.determinate.systems/nix | sh -s -- install --no-confirm \
297
+ --extra-conf " substituters = https://cache.nixos.org https://nix-postgres-artifacts.s3.amazonaws.com" \
298
+ --extra-conf " trusted-public-keys = nix-postgres-artifacts:dGZlQOvKcNEjvT7QEAJbcV6b6uk7VF/hWMjhYleiaLI=% cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY="
299
+ fi
289
300
else
290
301
echo " 1.1. Nix is installed; moving on."
291
302
fi
0 commit comments