Skip to content

T2.1 — Nix-built devcontainer image (buildLayeredImage), non-publishing #634

Closed

Description

@c-vigo

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 (or streamLayeredImage)
    whose contents include the Nix package manager (CppNix or pkgs.lix) + a baked flake dev
    profile (nix profile install .#devShell or an equivalent baked nix develop profile).
  • Reproduce the workspace-bootstrap layers the Debian build provides:
    • locale via glibcLocales + LOCALE_ARCHIVE (no locale-gen),
    • /root/assets,
    • pre-commit cache,
    • template .venv via Nix's uv/python with UV_PYTHON_DOWNLOADS=never +
      UV_PYTHON=<nix python314>.
  • 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:

Tasks

  • Add packages.devcontainerImage via buildLayeredImage (nix CLI in the closure)
  • Bake the flake dev profile
  • Reproduce locale / /root/assets / pre-commit cache / template .venv layers
  • 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.lock on another host yields an identical image digest.
  • Final image size is recorded and within budget (target: ≤ the current Debian :slim image;
    flag and justify if the closure exceeds it).

Dependencies

Files

  • flake.nix
  • .github/workflows/*

Test notes

Related issues

Activity

  1. added
    feature
    area:image
    on Jun 23, 2026
  2. c-vigo commented on Jul 1, 2026

    @c-vigo
    ContributorAuthor

    Delivered on dev via the Nix-migration epic PR #670 (merged 2026-06-30). packages.devcontainerImage builds via dockerTools.buildLayeredImage (Nix in-closure, no FROM); nix-image.yml builds and tests it. Closing as complete — this stayed open only because the epic merged to dev (not main) and these T/C-track issues carry Tracking: #625 but were never linked as GitHub sub-issues, so sync-issues auto-close never fired (tracked by #677). Refs #625.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:imagefeature

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions