Skip to content

T4.2 — Downstream pattern: minimal flake stub (non-overwriting) + nix2container production builder #640

Closed

Description

@c-vigo

Tracking: #625

Context

Downstream repos consume the toolchain via a flake input, so "update the dev environment"
means bumping that input — it never overwrites user files. This mirrors the existing
justfile.base → justfile.project → justfile.local layering: a managed upstream + a
user-owned, never-overwritten local layer. Only a minimal flake ships here; richer
language shells are future work.

Scope

In:

  • Add a minimal downstream flake.nix scaffold:
    • inputs.vigos.url = "github:vig-os/devcontainer",
    • nixpkgs.follows = "vigos/nixpkgs",
    • a placeholder extraPackages = pkgs: [ /* add project tools here */ ]; with inline
      instructions.
  • Add .envrc (use flake).
  • Mark both as scaffold-once / never-overwrite in scripts/manifest.toml (same class as
    docker-compose.project.yaml / justfile.local) so sync_manifest.py never clobbers user
    edits on a dev-env update.
  • Document & scaffold nix2container as the SSoT-derived builder for production/runtime
    images in other packages
    (separate from the devcontainer image).

Out:

Tasks

  • Add the minimal downstream flake.nix scaffold with extraPackages placeholder
  • Add the .envrc stub
  • Mark both never-overwrite in manifest.toml; update sync_manifest.py if needed
  • Document + scaffold the nix2container production-image builder pattern
  • Document the future modular-shells extension point

Acceptance criteria

  • A downstream repo gets a working flake.nix + .envrc.
  • A simulated dev-env update does not overwrite user extraPackages.
  • The nix2container production-image example builds.

Dependencies

Files

  • assets/workspace/flake.nix
  • assets/workspace/.envrc
  • scripts/manifest.toml
  • scripts/sync_manifest.py
  • docs

Test notes

  • Add a sync test asserting never-overwrite behaviour for the flake / .envrc file class.

Activity

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

    @c-vigo
    ContributorAuthor

    Done via PR #662 (landed on dev through the #625 epic PR #670). Ships assets/workspace/flake.nix + .envrc (toolchain as a flake input, marked never-overwrite in init-workspace.sh PRESERVE_FILES), the nix2container production-builder pattern (docs/NIX2CONTAINER.md + buildable examples/nix2container-production/), and a tests/test_downstream_flake.py CI gate.

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:imagearea:workspacefeature

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions