Skip to content

Commit cb314c1

Browse files
authored
fix: enable stickydisk again with new nix-installer-action (#2017)
* fix: enable stickydisk again with new nix-installer-action * feat: use nix 2.33.1 everywhere
1 parent 9c9785f commit cb314c1

10 files changed

Lines changed: 29 additions & 29 deletions

File tree

.github/actions/nix-install-ephemeral/action.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,10 @@ runs:
4040
sudo chmod +x /etc/nix/upload-to-cache.sh
4141
env:
4242
NIX_SIGN_SECRET_KEY: ${{ env.NIX_SIGN_SECRET_KEY }}
43-
- name: Install nix
44-
uses: cachix/install-nix-action@4e002c8ec80594ecd40e759629461e26c8abed15 # v31.9.0
43+
- uses: NixOS/nix-installer-action@d6ef7ecd8f685af89869e5aca0580a33e3e3150c
4544
with:
46-
install_url: https://releases.nixos.org/nix/nix-2.32.2/install
47-
extra_nix_config: |
45+
installer-version: 2.33.1
46+
extra-conf: |
4847
substituters = https://cache.nixos.org https://nix-postgres-artifacts.s3.amazonaws.com
4948
trusted-public-keys = nix-postgres-artifacts:dGZlQOvKcNEjvT7QEAJbcV6b6uk7VF/hWMjhYleiaLI= cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=
5049
${{ inputs.push-to-cache == 'true' && 'post-build-hook = /etc/nix/upload-to-cache.sh' || '' }}

.github/workflows/base-image-nightly.yml

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -26,21 +26,13 @@ jobs:
2626
with:
2727
ref: ${{ github.event.inputs.branch || 'develop' }}
2828

29-
- name: Configure AWS credentials
30-
uses: aws-actions/configure-aws-credentials@7474bc4690e29a8392af63c5b98e7449536d5c3a # v4.3.1
29+
- name: Install nix (ephemeral)
30+
uses: ./.github/actions/nix-install-ephemeral
3131
with:
32-
role-to-assume: ${{ secrets.DEV_AWS_ROLE }}
33-
aws-region: "us-east-1"
34-
output-credentials: true
35-
role-duration-seconds: 7200
36-
37-
- name: Install nix
38-
uses: cachix/install-nix-action@ba0dd844c9180cbf77aa72a116d6fbc515d0e87b # v27
39-
with:
40-
install_url: https://releases.nixos.org/nix/nix-2.29.1/install
41-
extra_nix_config: |
42-
substituters = https://cache.nixos.org https://nix-postgres-artifacts.s3.amazonaws.com
43-
trusted-public-keys = nix-postgres-artifacts:dGZlQOvKcNEjvT7QEAJbcV6b6uk7VF/hWMjhYleiaLI= cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=
32+
push-to-cache: 'true'
33+
env:
34+
DEV_AWS_ROLE: ${{ secrets.DEV_AWS_ROLE }}
35+
NIX_SIGN_SECRET_KEY: ${{ secrets.NIX_SIGN_SECRET_KEY }}
4436

4537
- name: Set execution ID and timestamp
4638
run: |

.github/workflows/nix-eval.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,15 @@ jobs:
2424
steps:
2525
- name: Checkout Repo
2626
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
27+
- name: Mount Nix cache disk
28+
uses: useblacksmith/stickydisk@a652394bf1bf95399f406e648482b41fbd25c51f # v1
29+
with:
30+
key: ${{ github.repository }}-nix-cache-eval-${{ runner.os }}
31+
path: /nix
32+
- name: Remove existing Nix socket
33+
run: |
34+
sudo rm /nix/var/nix/daemon-socket/socket /nix/receipt.json || true
35+
sudo chown root /nix /nix/var /nix/var/nix || true
2736
- name: Install nix
2837
uses: ./.github/actions/nix-install-ephemeral
2938
with:

Dockerfile-15

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ extra-experimental-features = nix-command flakes
106106
extra-substituters = https://nix-postgres-artifacts.s3.amazonaws.com
107107
extra-trusted-public-keys = nix-postgres-artifacts:dGZlQOvKcNEjvT7QEAJbcV6b6uk7VF/hWMjhYleiaLI=
108108
EOF
109-
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
109+
RUN curl -L https://releases.nixos.org/nix/nix-2.33.1/install | sh -s -- --daemon --no-channel-add --yes --nix-extra-conf-file /tmp/extra-nix.conf
110110
ENV PATH="${PATH}:/nix/var/nix/profiles/default/bin"
111111

112112
COPY . /nixpg

Dockerfile-17

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ extra-experimental-features = nix-command flakes
108108
extra-substituters = https://nix-postgres-artifacts.s3.amazonaws.com
109109
extra-trusted-public-keys = nix-postgres-artifacts:dGZlQOvKcNEjvT7QEAJbcV6b6uk7VF/hWMjhYleiaLI=
110110
EOF
111-
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
111+
RUN curl -L https://releases.nixos.org/nix/nix-2.33.1/install | sh -s -- --daemon --no-channel-add --yes --nix-extra-conf-file /tmp/extra-nix.conf
112112

113113
ENV PATH="${PATH}:/nix/var/nix/profiles/default/bin"
114114

Dockerfile-orioledb-17

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ extra-experimental-features = nix-command flakes
108108
extra-substituters = https://nix-postgres-artifacts.s3.amazonaws.com
109109
extra-trusted-public-keys = nix-postgres-artifacts:dGZlQOvKcNEjvT7QEAJbcV6b6uk7VF/hWMjhYleiaLI=
110110
EOF
111-
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
111+
RUN curl -L https://releases.nixos.org/nix/nix-2.33.1/install | sh -s -- --daemon --no-channel-add --yes --nix-extra-conf-file /tmp/extra-nix.conf
112112

113113
ENV PATH="${PATH}:/nix/var/nix/profiles/default/bin"
114114

ansible/files/admin_api_scripts/pg_upgrade_scripts/initiate.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,7 @@ function initiate_upgrade {
297297
--extra-conf "trusted-public-keys = nix-postgres-artifacts:dGZlQOvKcNEjvT7QEAJbcV6b6uk7VF/hWMjhYleiaLI= cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY="
298298
else
299299
echo "1.1.1. Installing Nix using the official installer"
300-
sh <(curl -L https://releases.nixos.org/nix/nix-2.32.2/install) --yes --daemon --nix-extra-conf-file /dev/stdin <<EXTRA_NIX_CONF
300+
sh <(curl -L https://releases.nixos.org/nix/nix-2.33.1/install) --yes --daemon --nix-extra-conf-file /dev/stdin <<EXTRA_NIX_CONF
301301
extra-experimental-features = nix-command flakes
302302
extra-substituters = https://nix-postgres-artifacts.s3.amazonaws.com
303303
extra-trusted-public-keys = nix-postgres-artifacts:dGZlQOvKcNEjvT7QEAJbcV6b6uk7VF/hWMjhYleiaLI=

ebssurrogate/scripts/qemu-bootstrap-nix.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ execute_playbook
8282
####################
8383

8484
function install_nix() {
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
85+
sudo su -c "sh <(curl -L https://releases.nixos.org/nix/nix-2.33.1/install) --yes --daemon --nix-extra-conf-file /dev/stdin <<EXTRA_NIX_CONF
8686
extra-experimental-features = nix-command flakes
8787
extra-substituters = https://nix-postgres-artifacts.s3.amazonaws.com
8888
extra-trusted-public-keys = nix-postgres-artifacts:dGZlQOvKcNEjvT7QEAJbcV6b6uk7VF/hWMjhYleiaLI=

nix/docs/start-here.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -83,12 +83,12 @@ extra-substituters =
8383

8484
**Important**: Replace `YOUR_USERNAME` with your actual username in the `trusted-users` line.
8585

86-
### Step 2: Install Nix 2.29.2
86+
### Step 2: Install Nix 2.33.1
8787

88-
Run the following command to install Nix 2.29.2 (the version used in CI) with the custom configuration:
88+
Run the following command to install Nix 2.33.1 (the version used in CI) with the custom configuration:
8989

9090
```bash
91-
curl -L https://releases.nixos.org/nix/nix-2.29.2/install | sh -s -- --daemon --yes --nix-extra-conf-file ./nix.conf
91+
curl -L https://releases.nixos.org/nix/nix-2.33.1/install | sh -s -- --daemon --yes --nix-extra-conf-file ./nix.conf
9292
```
9393

9494
This will install Nix with our build caches pre-configured, which should eliminate substituter-related errors.
@@ -103,7 +103,7 @@ same commands on your machine:
103103

104104
```
105105
$ nix --version
106-
nix (Nix) 2.29.2
106+
nix (Nix) 2.33.1
107107
```
108108

109109
```
@@ -112,7 +112,7 @@ $ nix run nixpkgs#nix-info -- -m
112112
- host os: `Linux 5.15.90.1-microsoft-standard-WSL2, Ubuntu, 22.04.2 LTS (Jammy Jellyfish), nobuild`
113113
- multi-user?: `yes`
114114
- sandbox: `yes`
115-
- version: `nix-env (Nix) 2.29.2`
115+
- version: `nix-env (Nix) 2.33.1`
116116
- channels(root): `"nixpkgs"`
117117
- nixpkgs: `/nix/var/nix/profiles/per-user/root/channels/nixpkgs`
118118
```

scripts/nix-provision.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ function install_packages {
2828

2929

3030
function install_nix() {
31-
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
31+
sudo su -c "sh <(curl -L https://releases.nixos.org/nix/nix-2.33.1/install) --yes --daemon --nix-extra-conf-file /dev/stdin <<EXTRA_NIX_CONF
3232
extra-experimental-features = nix-command flakes
3333
extra-substituters = https://nix-postgres-artifacts.s3.amazonaws.com
3434
extra-trusted-public-keys = nix-postgres-artifacts:dGZlQOvKcNEjvT7QEAJbcV6b6uk7VF/hWMjhYleiaLI=

0 commit comments

Comments
 (0)