ci: set nix options through NIX_CONFIG
The runner mounts a persistent nix-store volume over /nix. The current nixos/nix image makes /etc/nix/nix.conf a symlink into /nix/store, and the volume does not hold that path, so the link dangles and appending to it fails before checkout: "/etc/nix/nix.conf: No such file or directory". Pass the settings in NIX_CONFIG instead. Without a config file Nix also falls back to build-users-group = nixbld, which the container lacks, so set it empty and turn the sandbox off, as the image config does. Assisted-by: Claude:opus-5-5
This commit is contained in:
parent
9ea965190a
commit
642bec845a
2 changed files with 16 additions and 2 deletions
|
|
@ -10,6 +10,14 @@ jobs:
|
||||||
# so a red suite blocks the build+deploy — Forgejo has no cross-workflow needs.
|
# so a red suite blocks the build+deploy — Forgejo has no cross-workflow needs.
|
||||||
test:
|
test:
|
||||||
runs-on: nix-latest
|
runs-on: nix-latest
|
||||||
|
# Settings via env, not /etc/nix/nix.conf: in the image that is a
|
||||||
|
# symlink into /nix/store, which the runner's nix-store volume
|
||||||
|
# shadows, so it dangles once the image moves on.
|
||||||
|
env:
|
||||||
|
NIX_CONFIG: |
|
||||||
|
experimental-features = nix-command flakes
|
||||||
|
build-users-group =
|
||||||
|
sandbox = false
|
||||||
services:
|
services:
|
||||||
postgres:
|
postgres:
|
||||||
image: postgres:17-alpine
|
image: postgres:17-alpine
|
||||||
|
|
@ -20,7 +28,6 @@ jobs:
|
||||||
steps:
|
steps:
|
||||||
- name: Prepare container for actions
|
- name: Prepare container for actions
|
||||||
run: |
|
run: |
|
||||||
echo "experimental-features = nix-command flakes" >> /etc/nix/nix.conf
|
|
||||||
# node for JS actions (checkout); git-minimal is already in the image
|
# node for JS actions (checkout); git-minimal is already in the image
|
||||||
nix-env -iA nixpkgs.nodejs_22
|
nix-env -iA nixpkgs.nodejs_22
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -10,6 +10,14 @@ on:
|
||||||
jobs:
|
jobs:
|
||||||
test:
|
test:
|
||||||
runs-on: nix-latest
|
runs-on: nix-latest
|
||||||
|
# Settings via env, not /etc/nix/nix.conf: in the image that is a
|
||||||
|
# symlink into /nix/store, which the runner's nix-store volume
|
||||||
|
# shadows, so it dangles once the image moves on.
|
||||||
|
env:
|
||||||
|
NIX_CONFIG: |
|
||||||
|
experimental-features = nix-command flakes
|
||||||
|
build-users-group =
|
||||||
|
sandbox = false
|
||||||
services:
|
services:
|
||||||
# CI stand-in for bin/test's ephemeral Postgres: the nix container runs
|
# CI stand-in for bin/test's ephemeral Postgres: the nix container runs
|
||||||
# as root and initdb refuses to run as root, so the DB lives in a
|
# as root and initdb refuses to run as root, so the DB lives in a
|
||||||
|
|
@ -26,7 +34,6 @@ jobs:
|
||||||
steps:
|
steps:
|
||||||
- name: Prepare container for actions
|
- name: Prepare container for actions
|
||||||
run: |
|
run: |
|
||||||
echo "experimental-features = nix-command flakes" >> /etc/nix/nix.conf
|
|
||||||
# node for JS actions (checkout); git-minimal is already in the image
|
# node for JS actions (checkout); git-minimal is already in the image
|
||||||
nix-env -iA nixpkgs.nodejs_22
|
nix-env -iA nixpkgs.nodejs_22
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue