Repository navigation
Description
Tracking: #625
Context
Build the devcontainer image with Nix itself (dockerTools.buildLayeredImage /
streamLayeredImage) rather than a Dockerfile FROM, so the Nix package manager (CppNix or
pkgs.lix) is included as a closure layer and nix/direnv are live inside the container,
identical to the direnv path. This refines the "base = nixos/nix" decision: same outcome
(nix CLI live in the container, minimal — no NixOS distro), but assembled by Nix so the build
is bit-reproducible (the master's "identical image digest" acceptance criterion holds —
a Dockerfile FROM build would not be reproducible). nix2container stays reserved for
downstream production images. This is the discovery phase for FHS breakage and ships behind
continue-on-error until the portable test suite (#635) is in place.
Scope
In:
packages.devcontainerImage=dockerTools.buildLayeredImage(orstreamLayeredImage)
whose contents include the Nix package manager (CppNix orpkgs.lix) + a baked flake dev
profile (nix profile install .#devShellor an equivalent bakednix developprofile).- Reproduce the workspace-bootstrap layers the Debian build provides:
- locale via
glibcLocales+LOCALE_ARCHIVE(nolocale-gen), /root/assets,- pre-commit cache,
- template
.venvvia Nix's uv/python withUV_PYTHON_DOWNLOADS=never+
UV_PYTHON=<nix python314>.
- locale via
- New CI job builds the image + runs testinfra
continue-on-error: true. - In-container evaluator decided here (CppNix as shipped vs add
pkgs.lix).
Out:
- Publishing the image (T4.1 — Publish-cutover to the Nix image (GATED) #639).
- Multi-arch (T2.3 — Multi-arch Nix image (amd64 + arm64) #636).
Tasks
- Add
packages.devcontainerImageviabuildLayeredImage(nix CLI in the closure) - Bake the flake dev profile
- Reproduce locale /
/root/assets/ pre-commit cache / template.venvlayers - Add the non-publishing CI build + testinfra job (
continue-on-error) - Decide the in-container evaluator included in the closure (CppNix vs
pkgs.lix)
Acceptance criteria
- Image builds.
- Portable testinfra (T2.2 — Make the testinfra suite portable (TEST ADAPTATION) #635) passes against it.
- Rebuild from the same
flake.lockon another host yields an identical image digest. - Final image size is recorded and within budget (target: ≤ the current Debian
:slimimage;
flag and justify if the closure exceeds it).
Dependencies
- Depends-on: T1.1 — De-duplicate the flake into the real SSoT #631, C3 — Remove
cursor-agentinstall from the image #628. - Blocks: T2.3 — Multi-arch Nix image (amd64 + arm64) #636, T3.1 — vulnix + SBOM CVE scanning; re-author security policy #637, T4.1 — Publish-cutover to the Nix image (GATED) #639.
Files
flake.nix.github/workflows/*
Test notes
- Uses T2.2 — Make the testinfra suite portable (TEST ADAPTATION) #635's portable assertions; expect the first run to surface FHS gaps (missing shell
utilities, locale archive, paths). Iterate image contents until green.
Related issues
- [FEATURE] Bake agent-CLI toolkit + Claude Code into image (rg/fd/bat/eza/delta/lazygit/zoxide/starship/freeze/expect/nvim + IS_SANDBOX=1) #545 (bake agent-CLI toolkit + Claude Code) — carry its image-level requirements here:
claudeon PATH,ENV IS_SANDBOX=1(bypasses the uid-0 check for
--dangerously-skip-permissions; the container is the trust boundary), andcc/cld
aliases. The tool list itself lands indevTools(T1.1 — De-duplicate the flake into the real SSoT #631). Its ~+200 MB apt/binary approach is
replaced by the Nix closure. - [DISCUSSION] Migration to prek #40 (Migration to prek) — the pre-commit cache layer is rebuilt here; this is the moment
to decidepre-commitvsprek(both packaged in nixpkgs).
Activity
feat(nix): de-duplicate the flake into the toolchain SSoT (#651)
ci(nix): provision CI tooling via the flake dev-shell (#653)
feat(nix): build the devcontainer image with buildLayeredImage (non-p…
ci(nix): multi-arch Nix image discovery index (amd64 + arm64) (#636) (#…
ci(security): vulnix + SBOM CVE scanning for the Nix image (#637) (#660)
fix(scripts): Nix image scaffolds real writable files, not store syml…
feat(nix): Nix image toolchain parity — pass the full testinfra suite (…
test(nix): smoke-test the in-container nix/direnv runtime (#679)
fix(setup): unblock testinfra init fixture (dep-sync timeout + NixOS …
c-vigo commentedon Jul 1, 2026
Delivered on
devvia the Nix-migration epic PR #670 (merged 2026-06-30).packages.devcontainerImagebuilds viadockerTools.buildLayeredImage(Nix in-closure, noFROM);nix-image.ymlbuilds and tests it. Closing as complete — this stayed open only because the epic merged todev(notmain) and these T/C-track issues carryTracking: #625but were never linked as GitHub sub-issues, so sync-issues auto-close never fired (tracked by #677). Refs #625.chore: release 0.4.0 (#195)
chore: release 0.4.0 (#813)