Skip to content

Commit 00acba7

Browse files
committed
Merge PR #251: wait for the macOS Nix daemon
2 parents 7ef5c9a + 55fd623 commit 00acba7

1 file changed

Lines changed: 25 additions & 1 deletion

File tree

‎.github/workflows/nix-interop.yml‎

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,30 @@ jobs:
5151
experimental-features = nix-command flakes
5252
accept-flake-config = false
5353
54+
- name: Wait for the Nix store to become ready
55+
shell: bash
56+
run: |
57+
set -euo pipefail
58+
if [[ "$RUNNER_OS" != "macOS" ]]; then
59+
nix store ping
60+
exit 0
61+
fi
62+
63+
for attempt in $(seq 1 20); do
64+
if NIX_REMOTE=daemon nix store ping >/dev/null 2>&1; then
65+
printf 'NIX_REMOTE=daemon\n' >> "$GITHUB_ENV"
66+
exit 0
67+
fi
68+
echo "Nix daemon is not ready yet (attempt ${attempt}/20)" >&2
69+
sudo launchctl kickstart -k system/org.nixos.nix-daemon >/dev/null 2>&1 || true
70+
sleep 2
71+
done
72+
73+
sudo launchctl print system/org.nixos.nix-daemon || true
74+
ls -la /nix/var/nix/daemon-socket || true
75+
echo "Nix daemon did not become ready" >&2
76+
exit 1
77+
5478
- name: Load the locked Nixpkgs input
5579
shell: bash
5680
run: |
@@ -308,7 +332,7 @@ jobs:
308332
flags=re.MULTILINE,
309333
)
310334
if count != 1:
311-
raise SystemExit("expected one locked artifact sha256 to tamper")
335+
raise SystemExit("expected one locked artifact sha256 to tamper")
312336
path.write_text(text, encoding="utf-8")
313337
PY
314338

0 commit comments

Comments
 (0)