Skip to content

Commit a6689a3

Browse files
jfrochesamrose
authored andcommitted
feat: migrate from the DetSys Nix installer to the official Nix installer
Pin nix to v2.32.2 chore: bump to release
1 parent 336f49e commit a6689a3

File tree

7 files changed

+40
-33
lines changed

7 files changed

+40
-33
lines changed

Dockerfile-15

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -52,19 +52,19 @@ RUN apt update -y && apt install -y \
5252

5353
RUN adduser --system --home /var/lib/postgresql --no-create-home --shell /bin/bash --group --gecos "PostgreSQL administrator" postgres
5454
RUN adduser --system --no-create-home --shell /bin/bash --group wal-g
55-
RUN curl --proto '=https' --tlsv1.2 -sSf -L https://install.determinate.systems/nix | sh -s -- install linux \
56-
--init none \
57-
--no-confirm \
58-
--extra-conf "substituters = https://cache.nixos.org https://nix-postgres-artifacts.s3.amazonaws.com" \
59-
--extra-conf "trusted-public-keys = nix-postgres-artifacts:dGZlQOvKcNEjvT7QEAJbcV6b6uk7VF/hWMjhYleiaLI= cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY="
60-
55+
RUN cat <<EOF > /tmp/extra-nix.conf
56+
extra-experimental-features = nix-command flakes
57+
extra-substituters = https://nix-postgres-artifacts.s3.amazonaws.com
58+
extra-trusted-public-keys = nix-postgres-artifacts:dGZlQOvKcNEjvT7QEAJbcV6b6uk7VF/hWMjhYleiaLI=
59+
EOF
60+
RUN curl -L https://releases.nixos.org/nix/nix-2.32.2/install | sh -s -- --daemon --no-channel-add --yes --nix-extra-conf-file /tmp/extra-nix.conf
6161
ENV PATH="${PATH}:/nix/var/nix/profiles/default/bin"
6262

6363
COPY . /nixpg
6464

6565
WORKDIR /nixpg
6666

67-
RUN nix profile install .#psql_15/bin
67+
RUN nix profile install .#psql_15/bin
6868

6969
RUN nix store gc
7070

Dockerfile-17

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,12 @@ RUN apt update -y && apt install -y \
5454

5555
RUN adduser --system --home /var/lib/postgresql --no-create-home --shell /bin/bash --group --gecos "PostgreSQL administrator" postgres
5656
RUN adduser --system --no-create-home --shell /bin/bash --group wal-g
57-
RUN curl --proto '=https' --tlsv1.2 -sSf -L https://install.determinate.systems/nix | sh -s -- install linux \
58-
--init none \
59-
--no-confirm \
60-
--extra-conf "substituters = https://cache.nixos.org https://nix-postgres-artifacts.s3.amazonaws.com" \
61-
--extra-conf "trusted-public-keys = nix-postgres-artifacts:dGZlQOvKcNEjvT7QEAJbcV6b6uk7VF/hWMjhYleiaLI= cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY="
57+
RUN cat <<EOF > /tmp/extra-nix.conf
58+
extra-experimental-features = nix-command flakes
59+
extra-substituters = https://nix-postgres-artifacts.s3.amazonaws.com
60+
extra-trusted-public-keys = nix-postgres-artifacts:dGZlQOvKcNEjvT7QEAJbcV6b6uk7VF/hWMjhYleiaLI=
61+
EOF
62+
RUN curl -L https://releases.nixos.org/nix/nix-2.32.2/install | sh -s -- --daemon --no-channel-add --yes --nix-extra-conf-file /tmp/extra-nix.conf
6263

6364
ENV PATH="${PATH}:/nix/var/nix/profiles/default/bin"
6465

Dockerfile-orioledb-17

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,12 @@ RUN apt update -y && apt install -y \
5454

5555
RUN adduser --system --home /var/lib/postgresql --no-create-home --shell /bin/bash --group --gecos "PostgreSQL administrator" postgres
5656
RUN adduser --system --no-create-home --shell /bin/bash --group wal-g
57-
RUN curl --proto '=https' --tlsv1.2 -sSf -L https://install.determinate.systems/nix | sh -s -- install linux \
58-
--init none \
59-
--no-confirm \
60-
--extra-conf "substituters = https://cache.nixos.org https://nix-postgres-artifacts.s3.amazonaws.com" \
61-
--extra-conf "trusted-public-keys = nix-postgres-artifacts:dGZlQOvKcNEjvT7QEAJbcV6b6uk7VF/hWMjhYleiaLI= cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY="
57+
RUN cat <<EOF > /tmp/extra-nix.conf
58+
extra-experimental-features = nix-command flakes
59+
extra-substituters = https://nix-postgres-artifacts.s3.amazonaws.com
60+
extra-trusted-public-keys = nix-postgres-artifacts:dGZlQOvKcNEjvT7QEAJbcV6b6uk7VF/hWMjhYleiaLI=
61+
EOF
62+
RUN curl -L https://releases.nixos.org/nix/nix-2.32.2/install | sh -s -- --daemon --no-channel-add --yes --nix-extra-conf-file /tmp/extra-nix.conf
6263

6364
ENV PATH="${PATH}:/nix/var/nix/profiles/default/bin"
6465

ansible/files/admin_api_scripts/pg_upgrade_scripts/initiate.sh

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -289,10 +289,11 @@ function initiate_upgrade {
289289
--extra-conf "trusted-public-keys = nix-postgres-artifacts:dGZlQOvKcNEjvT7QEAJbcV6b6uk7VF/hWMjhYleiaLI= cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY="
290290
else
291291
echo "1.1.1. Installing Nix using the official installer"
292-
293-
curl --proto '=https' --tlsv1.2 -sSf -L https://install.determinate.systems/nix | sh -s -- install --no-confirm \
294-
--extra-conf "substituters = https://cache.nixos.org https://nix-postgres-artifacts.s3.amazonaws.com" \
295-
--extra-conf "trusted-public-keys = nix-postgres-artifacts:dGZlQOvKcNEjvT7QEAJbcV6b6uk7VF/hWMjhYleiaLI= cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY="
292+
sh <(curl -L https://releases.nixos.org/nix/nix-2.32.2/install) --yes --daemon --nix-extra-conf-file /dev/stdin <<EXTRA_NIX_CONF
293+
extra-experimental-features = nix-command flakes
294+
extra-substituters = https://nix-postgres-artifacts.s3.amazonaws.com
295+
extra-trusted-public-keys = nix-postgres-artifacts:dGZlQOvKcNEjvT7QEAJbcV6b6uk7VF/hWMjhYleiaLI=
296+
EXTRA_NIX_CONF
296297
fi
297298
else
298299
echo "1.1. Nix is installed; moving on."

ansible/vars.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ postgres_major:
1010

1111
# Full version strings for each major version
1212
postgres_release:
13-
postgresorioledb-17: "17.5.1.064-orioledb"
14-
postgres17: "17.6.1.043"
15-
postgres15: "15.14.1.043"
13+
postgresorioledb-17: "17.5.1.050-orioledb-inst-1"
14+
postgres17: "17.6.1.029-inst-1"
15+
postgres15: "15.14.1.029-inst-1"
1616

1717
# Non Postgres Extensions
1818
pgbouncer_release: 1.19.0

ebssurrogate/scripts/qemu-bootstrap-nix.sh

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -82,11 +82,13 @@ execute_playbook
8282
####################
8383

8484
function install_nix() {
85-
sudo su -c "curl --proto '=https' --tlsv1.2 -sSf -L https://install.determinate.systems/nix | sh -s -- install --no-confirm \
86-
--extra-conf \"substituters = https://cache.nixos.org https://nix-postgres-artifacts.s3.amazonaws.com\" \
87-
--extra-conf \"trusted-public-keys = nix-postgres-artifacts:dGZlQOvKcNEjvT7QEAJbcV6b6uk7VF/hWMjhYleiaLI= cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=\" " -s /bin/bash root
88-
. /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh
89-
85+
sudo su -c "sh <(curl -L https://releases.nixos.org/nix/nix-2.32.2/install) --yes --daemon --nix-extra-conf-file /dev/stdin <<EXTRA_NIX_CONF
86+
extra-experimental-features = nix-command flakes
87+
extra-substituters = https://nix-postgres-artifacts.s3.amazonaws.com
88+
extra-trusted-public-keys = nix-postgres-artifacts:dGZlQOvKcNEjvT7QEAJbcV6b6uk7VF/hWMjhYleiaLI=
89+
EXTRA_NIX_CONF" -s /bin/bash root
90+
#shellcheck disable=SC1091
91+
. /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh
9092
}
9193

9294
function execute_stage2_playbook {

scripts/nix-provision.sh

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,13 @@ function install_packages {
2323

2424

2525
function install_nix() {
26-
sudo su -c "curl --proto '=https' --tlsv1.2 -sSf -L https://install.determinate.systems/nix | sh -s -- install --no-confirm \
27-
--extra-conf \"substituters = https://cache.nixos.org https://nix-postgres-artifacts.s3.amazonaws.com\" \
28-
--extra-conf \"trusted-public-keys = nix-postgres-artifacts:dGZlQOvKcNEjvT7QEAJbcV6b6uk7VF/hWMjhYleiaLI= cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=\" " -s /bin/bash root
26+
sudo su -c "sh <(curl -L https://releases.nixos.org/nix/nix-2.32.2/install) --yes --daemon --nix-extra-conf-file /dev/stdin <<EXTRA_NIX_CONF
27+
extra-experimental-features = nix-command flakes
28+
extra-substituters = https://nix-postgres-artifacts.s3.amazonaws.com
29+
extra-trusted-public-keys = nix-postgres-artifacts:dGZlQOvKcNEjvT7QEAJbcV6b6uk7VF/hWMjhYleiaLI=
30+
EXTRA_NIX_CONF" -s /bin/bash root
31+
#shellcheck disable=SC1091
2932
. /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh
30-
3133
}
3234

3335

0 commit comments

Comments
 (0)