Repository navigation
Description
Context
vigOS/devcontainer publishes the shared image ghcr.io/vig-os/devcontainer (Debian
python:3.14-slim-bookworm) consumed across EXOMA/EXOPET/vigOS. Today the toolchain is
defined twice (curl-installed in Containerfile + a drifting flake.nix dev-shell),
the CVE posture is Debian/apt + Trivy + a .trivyignore expiry register, and agent tooling
is Cursor-based (.cursor/ = SSoT for rules/skills; cursor-agent CLI drives the
worktree pipelines; .claude/commands/*.md are wrappers into .cursor/skills/).
This epic eliminates toolchain duplication by making flake.nix the SSoT, delivers it as
both a nix develop/direnv shell and a Nix-built (buildLayeredImage) devcontainer image,
reworks the CVE/audit posture for a non-apt image, and migrates agent tooling from Cursor
to Claude-native. The pattern then rolls out across repos. nix2container is reserved for
downstream production images.
Confirmed decisions
- Flake = SSoT; Nix builds the devcontainer image.
- Image built with
dockerTools.buildLayeredImage(not a DockerfileFROM), with the
Nix package manager included as a closure layer — minimal, with Nix live inside, not
the NixOS distro. This is what makes the build bit-reproducible (identical-digest AC below).
Same outcome as the original "base =nixos/nix" intent (nix CLI live in the container),
assembled by Nix rather than pulled as a non-reproducible Docker base. Full NixOS distro = no. nix2containerreserved for production/runtime images in other packages.- Evaluator (Lix vs CppNix) = swappable config, off the critical path. Same language /
flakes / store / cache, so the whole stack is identical under either. Only touches the CI
installer (T1.1 — De-duplicate the flake into the real SSoT #631) and the in-container evaluator (T2.1 — Nix-built devcontainer image (buildLayeredImage), non-publishing #634: include CppNix orpkgs.lixin the
image closure). Reversible without flake changes. - CVE/audit rework (vulnix + SBOM) is in-scope.
- Drop all Cursor references → Claude-native (keep
cursorin the commit-msg agent
blocklist — that's the "never name an AI" control, not a dependency). - Install picker: the
curl-able install script lets the user choose
devcontainer / direnv / both (T4.3 — Install/init UX: choose devcontainer / direnv / both #641). - Minimal flake only. Ship a minimal downstream flake with placeholders +
instructions; user expansions must survive dev-env updates (scaffold-once, never-overwrite
— mirrorsjustfile.base→project→local). Modular shells (C++/Geant4/Data-Analysis) =
future, out of scope, mentioned only.
Scope
In:
- Tracking only — links the sub-issues below.
- Holds the confirmed decisions, dependency graph, and the T4.1 — Publish-cutover to the Nix image (GATED) #639 go/no-go gate.
Out:
- Modular language shells (C++ / Geant4 / Data-Analysis) — future work.
Sub-issues
- Track C — Cursor → Claude-native: C1 — Make
.claude/the SSoT for rules & skills #626, C2 — Replacecursor-agentwith theclaudeCLI in worktree pipelines #627, C3 — Removecursor-agentinstall from the image #628, C4 — Migrate templates & editor glue off Cursor #629, C5 — Adapt Cursor-coupled tests & keep the AI blocklist #630 - Track 1 — Flake as SSoT: T1.1 — De-duplicate the flake into the real SSoT #631, T1.2 — CI provisions tooling via the flake #632, T1.3 — direnv onboarding (nix-direnv) #633
- Track 2 — Nix-built image: T2.1 — Nix-built devcontainer image (
buildLayeredImage), non-publishing #634, T2.2 — Make the testinfra suite portable (TEST ADAPTATION) #635, T2.3 — Multi-arch Nix image (amd64 + arm64) #636 - Track 3 — CVE/audit rework: T3.1 — vulnix + SBOM CVE scanning; re-author security policy #637, T3.2 — Renovate
nixmanager forflake.lock#638 - Track 4 — Cutover & rollout: T4.1 — Publish-cutover to the Nix image (GATED) #639, T4.2 — Downstream pattern: minimal flake stub (non-overwriting) +
nix2containerproduction builder #640, T4.3 — Install/init UX: choose devcontainer / direnv / both #641, T4.4 — Decommission the Debian path #642
Dependency graph & parallelism
start in parallel: #626 #627 #631 #635
#627 ─► #628 ─► #630 #626 ─► #629
#628 ──────────────► (precedes) #634
#631 ─► #632
│ └─► #633 ─────────────┐
├─► #638 │
└─► #634 ─► #636 ─┐ │
#635 ─(parallel)──► ┘ gates #634-green
#634 ─► #637 ─┐ │
▼ ▼
#639 ─► #640 ─► #641 ─► #642
- Critical path:
#631 → #634 → #637 → #639 → #640 → #641 → #642. - Hard gate: T3.1 — vulnix + SBOM CVE scanning; re-author security policy #637 CVE gate (no unexcepted HIGH/CRITICAL) before the publish-cutover (T4.1 — Publish-cutover to the Nix image (GATED) #639).
- Start in parallel: C1 — Make
.claude/the SSoT for rules & skills #626, C2 — Replacecursor-agentwith theclaudeCLI in worktree pipelines #627, T1.1 — De-duplicate the flake into the real SSoT #631, T2.2 — Make the testinfra suite portable (TEST ADAPTATION) #635. - Conservative early-exit: stopping after T1.x + T2.2 — Make the testinfra suite portable (TEST ADAPTATION) #635 still delivers flake-as-dev-SSoT +
direnv onboarding while keeping the Debian image; T4.x is the only irreversible-ish step.
Acceptance criteria
- All sub-issues closed.
- Debian path decommissioned (T4.4 — Decommission the Debian path #642).
grep -ri cursorreturns only CHANGELOG history + the intentional commit-msg blocklist.- Reproducible rebuild from the same
flake.lockyields an identical image digest.
Global verification (end-to-end)
- Dev-shell/direnv:
nix develop -c bash -lc '<tool> --version'per tool; clean clone +
direnv allow→ working shell (warm cache: seconds). - Image parity: portable
just test-image+npx bats tests/bats/green on both
Debian and Nix images through T2–T4.1 — Publish-cutover to the Nix image (GATED) #639. - Multi-arch:
docker buildx imagetools inspect …:<tag>shows amd64+arm64; downstream
digest-pin resolves unchanged. - CVE gate: no unexcepted HIGH/CRITICAL vulnix finding on the Nix image; exception register
expiry checks pass. Trivy-vs-vulnix overlap diff archived as supporting evidence (not a
numeric parity requirement — different scan surfaces). - Claude-native: worktree pipelines drive
claude; commit-msg validation blocks both
cursorandclaude;grep -ri cursor→ only CHANGELOG history + the intentional blocklist. - Install picker:
--mode=devcontainer|direnv|botheach scaffolds exactly the right files. - Non-overwrite: simulated dev-env update preserves user
extraPackagesin the downstream
flake.nix. - Reproducibility: rebuild from the same
flake.lockon another host → identical image
digest.
Related existing issues
Scan of open repo issues (as of 2026-06-22) and how this epic relates to each.
| Issue | Relation | Verdict |
|---|---|---|
| #27 Adopt Nix/devenv for reproducible, auditable dependency management | This epic is the decided execution of #27 (same goal; #27 proposed devenv-or-flake + hybrid start, we go full flake-SSoT + nixos/nix image). Its IEC 62304 / SBOM / air-gapped framing is preserved in #637. |
Superseded — close #27, pointing here, after this epic is filed. |
| #255 Document Nix flake as alternative dev setup | Covered by #633 (note: targets docs/templates/CONTRIBUTE.md.j2 + experimental-features guidance). |
Superseded by #633 — close when #633 lands. |
| #545 Bake agent-CLI toolkit + Claude Code into image | Install mechanism (apt/curl) is replaced by Nix devTools (#631/#634); its requirements (tool list, claude baked, IS_SANDBOX=1, cc/cld aliases) must be absorbed into #631 + #634 + #627/#628. |
Partially superseded — re-scope to a requirements checklist consumed by #631/#634. |
| #546 Slim Claude Code OAuth-token forwarding | Shares the "claude baked" assumption (#545); its setup-claude.sh/non-root-user removal touches #629-adjacent scripts. Mostly remote-devc auth, otherwise independent. |
Related — cross-link; keep. |
| #604 Consolidate Trivy scan categories / clean stale alerts | The "single authoritative scan + document SSoT" goal is exactly #637's outcome; the orphaned-alert cleanup is worth doing regardless. | Partially superseded by #637. |
#602 / #521 Nightly scan HIGH/CRITICAL in :latest |
Tied to the Debian/apt image; the apt-CVE surface changes under the Nix image (#637) and these gates are re-pointed at vulnix. #521 (Apr) already stale vs #602 (Jun). | Will be superseded by #637 + #642. |
| #144 generate-docs hook misses skill dirs | docs/generate.py scans .cursor/skills/*/SKILL.md; #626 moves skills to .claude/skills/, changing both the hook filter and the scan path. |
Changed/absorbed by #626. |
| #40 Migration to prek | Nix migration is the natural moment to choose pre-commit vs prek (both in nixpkgs). |
Decision point — light ref from #634; not superseded. |
| #162 / #178 / #157 worktree-skill features | Built on the .cursor/skills/ + cursor-agent pipeline; #626 moves the paths and #627 swaps the CLI. |
Path/CLI changes — coordinate, not superseded. |
| #231 / #153 Cursor editor remote wrappers | Scope resolved: VS Code only. Cursor IDE support is dropped along with cursor-agent. |
Close #153; de-scope #231 to code-remote only (see #629). |
Activity
test(worktree): adapt cursor-coupled tests and keep the AI blocklist (#…
feat(nix): downstream flake stub (non-overwriting) + nix2container pa…
fix(scripts): Nix image scaffolds real writable files, not store syml…
feat(nix): Nix image toolchain parity — pass the full testinfra suite (…
docs(claude): clear residual cursor-agent references in pipeline docs (…
feat(scripts): make just init Nix-first; retire requirements.yaml (#672)
34 remaining items
fix: address PR #670 review nit batch (#772)
feat(nix): migrate the devcontainer to a Nix toolchain + Claude-nativ…
c-vigo commentedon Jul 3, 2026
Reproducible-build AC — evidence.
Local verification on commit
5bcd7d89(branchfeature/639-cutover-readiness, tip of dev + PR #808):/nix/store/ffy74m5xd5jadr5ckgpm81dm5p0xm90c-devcontainer.tar.gznix hash file:sha256-ZGHaXClfnwGaz3I3CpRq5vC/Xzsqc+BL/locfIEqf7I=--rebuildre-runs the derivation from scratch and fails if the output differs from the store copy, so this demonstrates bit-identical rebuild from the sameflake.lockon the same host/arch. The AC's stronger cross-host form gets confirmed for free at the 0.4.0 RC:release.ymlbuilds each arch on a separate native runner and the promoted digests are recorded in the release — comparing a second run of the same RC ref is the cross-host check if wanted.Cursor-grep AC status:
grep -ri cursorover the tree returns only (a) the intentional agent-blocklist entries + their tests, (b) CHANGELOG history, and (c) machine-synced issue/PR archives underdocs/issues//docs/pull-requests/plus one historical plan doc (docs/plans/2026-02-18-sync-workspace-templates-plan.md) — no live tooling references. AC met (archives are history, per the criterion's intent).chore: release 0.4.0 (#195)
chore: release 0.4.0 (#813)
docs: retire the documented Debian fallback path (T4.4) (#889)
c-vigo commentedon Jul 8, 2026
Closing — epic complete, all acceptance criteria met
All 17 sub-issues are closed and every acceptance criterion is satisfied:
.claude/the SSoT for rules & skills #626–C5 — Adapt Cursor-coupled tests & keep the AI blocklist #630), Track 1 (T1.1 — De-duplicate the flake into the real SSoT #631–T1.3 — direnv onboarding (nix-direnv) #633), Track 2 (T2.1 — Nix-built devcontainer image (buildLayeredImage), non-publishing #634–T2.3 — Multi-arch Nix image (amd64 + arm64) #636), Track 3 (T3.1 — vulnix + SBOM CVE scanning; re-author security policy #637–T3.2 — Renovatenixmanager forflake.lock#638), Track 4 (T4.1 — Publish-cutover to the Nix image (GATED) #639–T4.4 — Decommission the Debian path #642) all CLOSED.grep -ri cursorreturns only CHANGELOG/docs-archive history plus the intentional commit-msg AI blocklist (vig_utils/validate_commit_msg.py) — no live tooling references.nix build --rebuild(bit-identical output); see the evidence comment above.Every "related existing issue" this epic tracked is also resolved: #27, #255, #545, #546, #604, #602, #521, #144, #40, #162, #178, #157, #231, #153 — all CLOSED.
Nix toolchain (flake as SSoT), Nix-built multi-arch image, vulnix/SBOM CVE posture, and the Claude-native agent setup are all shipped. Follow-on work (devkit rename #781, dogfooding #822, home-manager modules #814) is tracked in its own issues.