Repository navigation
ci(nix): provision CI tooling via the flake dev-shell - #653
Merged
c-vigo merged 1 commit intoJun 23, 2026
Merged
Conversation
Add a provision-via-flake mode to the setup-env action that installs Nix (SHA-pinned) plus the vig-os Cachix substituter, builds the flake dev-shell, and prepends its tools to PATH so subsequent steps run inside the shell. The ad-hoc installs of uv/Python, just, hadolint, and taplo are gated off in this mode; podman, Node.js, BATS, and the devcontainer CLI keep their dedicated paths. Enable the mode across the CI build/test path (build-image, test-image, test-integration, project-checks). The Debian image is still built unchanged and the Docker type=gha cache stays intact. Refs: #632
c-vigo
marked this pull request as ready for review
June 23, 2026 11:51
c-vigo
merged commit Jun 23, 2026
f0634cb
into
feature/625-nix-claude-migration
12 of 18 checks passed
c-vigo
added a commit
that referenced
this pull request
Jun 23, 2026
## Summary Follow-up fix for #632 (T1.2). PR #653 enabled flake-provisioned CI but its `Build Container Image` and `Project Checks` jobs failed. PR #653 was already squash-merged into the epic at the broken state, so this lands as a new PR against `feature/625-nix-claude-migration`. Three coordinated fixes, one root chain: ### 1. uv could not provide CPython 3.14.6 `uv sync --frozen --all-extras` failed with `No interpreter found for Python 3.14.6`. Causes: - The project pins an **exact** patch (`requires-python == 3.14.6`, also in `uv.lock`). nixpkgs does not package it — `nixos-25.05` has `python314 == 3.14.0`, `nixpkgs-unstable` has `3.14.4`; a Nix interpreter is rejected by `uv --frozen` as incompatible. - The **nixpkgs build of `uv`** ships with its embedded Python-download list stripped, so it cannot fetch a managed CPython on its own. **Fix:** set `UV_PYTHON_DOWNLOADS_JSON_URL` in the flake dev-shell (`mkProjectShell` in `flake.nix`, the toolchain SSoT) to upstream uv's `download-metadata.json`, pinned to the same uv release the non-flake CI path installs (`0.11.23`). This restores managed downloads without un-pinning nixpkgs. `UV_PYTHON_DOWNLOADS` keeps its default. ### 2. The variable did not reach CI steps `GITHUB_PATH` only carries PATH, not env vars, so the dev-shell variable never reached the `uv sync` step. **Fix:** forward `UV_PYTHON_DOWNLOADS_JSON_URL` from the dev-shell to `GITHUB_ENV` in the `provision-via-flake` setup step. ### 3. The flake's podman shadowed the host podman With (1)+(2) fixed, build/image/integration jobs went green but `Project Checks` still failed: a BATS dry-run test (`tests/bats/install.bats`) errored because `install.sh` runs `podman info` and the flake's nix-store podman cannot reach the runner's setuid `newuidmap`/`newgidmap`. **Fix:** exclude the flake podman bin from the `provision-via-flake` PATH export so the runner's rootless-configured host podman is used (matches the documented intent on the `provision-via-flake` input). The flake's `devTools` (and the parity test) are unchanged. ### Validation - `nix develop -c uv sync --frozen --all-extras` succeeds; dev-shell and venv both report **Python 3.14.6**. - `pre-commit run --all-files` green; flake parity test passes; `nix flake check` passes. - Full CI on this branch is **green**: Build Container Image, Project Checks, Image Tests, Integration Tests, Security Scan, Python Security Scan, Test Summary. Refs: #632
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
CI now provisions its build/test toolchain from the Nix flake (the toolchain SSoT, #631) via
nix develop, proving thevig-osCachix binary cache under real CI load before any image risk (T2.1/#634) is taken.setup-envaction gains aprovision-via-flakemode: installs Nix (SHA-pinnedcachix/install-nix-action, matchingnix-cachix.yml) and thevig-osCachix substituter, builds the flake dev-shell, and prepends its nix-store bin dirs toGITHUB_PATHso every subsequent step runs as if insidenix develop.newuidmap/newgidmapand host container config for rootless mode; BATS/devcontainer-CLI are not in the flake.build-image,test-image,test-integration,project-checks. The cache name (vars.CACHIX_CACHE) and token (secrets.CACHIX_AUTH_TOKEN) are threaded fromci.ymlthrough each action intosetup-env.Out of scope (unchanged)
buildLayeredImage), non-publishing #634.type=ghabuild cache stays intact in parallel.Verification
Local (host Nix 2.34.7):
nix flake metadataresolves the flake.nix develop ... --commandbuilds the dev-shell and reports the gated tools:uv 0.11.19,just 1.40.0,hadolint 2.12.0,taplo 0.9.3,node v22.20.0,jq 1.7.1,gh 2.94.0./nix/store/*/bindirs from the dev-shell$PATH(just/uv/hadolint/taplo/node/git/gh all present) — exactly what gets appended toGITHUB_PATH.just precommitgreen (ruff, yamllint, taplo, shellcheck, hadolint, pymarkdown, check-action-pins, sync-manifest, agent-identity, branch-name).Full CI build-time cold-vs-warm Cachix comparison (issue test note) will come from this PR's own CI run.
Refs: #632