Skip to content

Commit 34497ce

Browse files
committed
fix: for now keep nix and inherit env
1 parent d73fb5f commit 34497ce

File tree

2 files changed

+16
-38
lines changed

2 files changed

+16
-38
lines changed

.github/workflows/ami-release-nix.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -79,18 +79,18 @@ jobs:
7979
POSTGRES_MAJOR_VERSION: ${{ env.POSTGRES_MAJOR_VERSION }}
8080
run: |
8181
GIT_SHA=${{github.sha}}
82-
sudo nix run github:supabase/postgres/${GIT_SHA}#packer -- init amazon-arm64-nix.pkr.hcl
82+
sudo -E nix run github:supabase/postgres/${GIT_SHA}#packer -- init amazon-arm64-nix.pkr.hcl
8383
# why is postgresql_major defined here instead of where the _three_ other postgresql_* variables are defined?
84-
sudo nix run github:supabase/postgres/${GIT_SHA}#packer -- build -var "git-head-version=${GIT_SHA}" -var "packer-execution-id=${GITHUB_RUN_ID}" -var-file="development-arm.vars.pkr.hcl" -var-file="common-nix.vars.pkr.hcl" -var "ansible_arguments=-e postgresql_major=${POSTGRES_MAJOR_VERSION}" amazon-arm64-nix.pkr.hcl
84+
sudo -E nix run github:supabase/postgres/${GIT_SHA}#packer -- build -var "git-head-version=${GIT_SHA}" -var "packer-execution-id=${GITHUB_RUN_ID}" -var-file="development-arm.vars.pkr.hcl" -var-file="common-nix.vars.pkr.hcl" -var "ansible_arguments=-e postgresql_major=${POSTGRES_MAJOR_VERSION}" amazon-arm64-nix.pkr.hcl
8585
8686
- name: Build AMI stage 2
8787
env:
8888
POSTGRES_MAJOR_VERSION: ${{ env.POSTGRES_MAJOR_VERSION }}
8989
run: |
9090
GIT_SHA=${{github.sha}}
91-
sudo nix run github:supabase/postgres/${GIT_SHA}#packer -- init stage2-nix-psql.pkr.hcl
91+
sudo -E nix run github:supabase/postgres/${GIT_SHA}#packer -- init stage2-nix-psql.pkr.hcl
9292
POSTGRES_MAJOR_VERSION=${{ env.POSTGRES_MAJOR_VERSION }}
93-
sudo nix run github:supabase/postgres/${GIT_SHA}#packer -- build -var "git_sha=${GIT_SHA}" -var "git-head-version=${GIT_SHA}" -var "packer-execution-id=${GITHUB_RUN_ID}" -var "postgres_major_version=${POSTGRES_MAJOR_VERSION}" -var-file="development-arm.vars.pkr.hcl" -var-file="common-nix.vars.pkr.hcl" stage2-nix-psql.pkr.hcl
93+
sudo -E nix run github:supabase/postgres/${GIT_SHA}#packer -- build -var "git_sha=${GIT_SHA}" -var "git-head-version=${GIT_SHA}" -var "packer-execution-id=${GITHUB_RUN_ID}" -var "postgres_major_version=${POSTGRES_MAJOR_VERSION}" -var-file="development-arm.vars.pkr.hcl" -var-file="common-nix.vars.pkr.hcl" stage2-nix-psql.pkr.hcl
9494
9595
- name: Grab release version
9696
id: process_release_version

.github/workflows/testinfra-ami-build.yml

Lines changed: 12 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -54,42 +54,20 @@ jobs:
5454
- name: Checkout Repo
5555
uses: supabase/postgres/.github/actions/shared-checkout@HEAD
5656

57-
- name: Diagnose existing Nix installation
57+
- name: Remove existing DeterminateSystems Nix installation
5858
run: |
59-
echo "=== Nix installation diagnostics ==="
59+
# Use the built-in DeterminateSystems uninstaller
60+
if [ -f /nix/nix-installer ]; then
61+
echo "Found DeterminateSystems nix-installer, using built-in uninstaller"
62+
sudo /nix/nix-installer uninstall --no-confirm || true
63+
else
64+
echo "No DeterminateSystems installer found to uninstall"
65+
fi
6066
61-
# Check if nix command exists and where
62-
which nix || echo "nix command not found in PATH"
63-
ls -la /nix 2>/dev/null || echo "/nix directory does not exist"
64-
65-
# Check installation method traces
66-
echo "--- Checking for DeterminateSystems installer traces ---"
67-
ls -la /nix/.nix-installer* 2>/dev/null || echo "No DeterminateSystems installer traces found"
68-
cat /nix/.nix-installer* 2>/dev/null || echo "No installer receipt file"
69-
70-
echo "--- Checking for cachix installer traces ---"
71-
ls -la /etc/systemd/system/nix-daemon.service 2>/dev/null || echo "No systemd nix-daemon service"
72-
systemctl status nix-daemon 2>/dev/null || echo "nix-daemon not running via systemd"
73-
74-
echo "--- Checking for manual installation traces ---"
75-
ls -la /etc/bash.bashrc | grep -C2 nix || echo "No nix in /etc/bash.bashrc"
76-
ls -la /etc/profile | grep -C2 nix || echo "No nix in /etc/profile"
77-
78-
echo "--- Checking nix store and configuration ---"
79-
ls -la /nix/store 2>/dev/null | head -10 || echo "No /nix/store"
80-
ls -la /etc/nix/ 2>/dev/null || echo "No /etc/nix directory"
81-
cat /etc/nix/nix.conf 2>/dev/null || echo "No /etc/nix/nix.conf"
82-
83-
echo "--- Checking user-level nix ---"
84-
ls -la ~/.nix-* 2>/dev/null || echo "No user nix directories"
85-
env | grep -i nix || echo "No nix environment variables"
86-
87-
echo "--- Checking processes ---"
88-
ps aux | grep -i nix || echo "No nix processes running"
89-
90-
echo "--- Checking nix version and info ---"
91-
nix --version 2>/dev/null || echo "Cannot get nix version"
92-
nix show-config 2>/dev/null || echo "Cannot show nix config"
67+
# Verify removal
68+
echo "Verifying nix removal..."
69+
which nix || echo "nix command no longer available"
70+
ls -la /nix 2>/dev/null || echo "/nix directory removed"
9371
9472
- name: Install nix
9573
uses: cachix/install-nix-action@v27

0 commit comments

Comments
 (0)