Skip to content

feat(nix): downstream flake stub (non-overwriting) + nix2container pattern (#640) - #662

Merged
c-vigo merged 1 commit into
feature/625-nix-claude-migrationfrom
feature/640-downstream-flake-stub
Jun 23, 2026
Merged

c-vigo merged 1 commit into
feature/625-nix-claude-migrationfrom
feature/640-downstream-flake-stub

Conversation

@c-vigo

@c-vigo c-vigo commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

Summary

Implements T4.2 (#640): downstream repos consume the shared toolchain as a flake input (so "update the dev env" = bump the input, never overwrites user files), plus the nix2container production-image pattern.

  • assets/workspace/flake.nix — minimal stub: vigos.url = github:vig-os/devcontainer, nixpkgs.follows = vigos/nixpkgs, flake-utils.follows = vigos/flake-utils, devShells.default = vigos.lib.mkProjectShell { … extraPackages } with a placeholder extraPackages block (the user's, never overwritten).
  • assets/workspace/.envrc — use flake via nix-direnv (mirrors the root onboarding from T1.3 — direnv onboarding (nix-direnv) #633).
  • Never-overwrite — added flake.nix + .envrc to PRESERVE_FILES in init-workspace.sh (same class as justfile.project). Reconciliation: the issue named manifest.toml/sync_manifest.py, but that path only mirrors repo→template and always overwrites — the actual scaffold-once guarantee for downstream user edits is PRESERVE_FILES (consulted by the --force upgrade rsync). Also un-ignored the template .envrc in assets/workspace/.gitignore (keeping .direnv/ + .envrc.local ignored) and broadened the shellcheck exclude to .envrc at any path.
  • nix2container — docs/NIX2CONTAINER.md + a buildable examples/nix2container-production/ deriving a minimal runtime image from the same pinned nixpkgs (distinct from the devcontainer's buildLayeredImage). Future modular language shells noted as an opt-in extension point.

Verified locally

  • Downstream stub devShells.default evaluates against the epic flake (--override-input vigos path:… → nix-shell).
  • nix2container example evaluates to a valid image derivation.
  • New init-workspace.bats assertions (stub scaffolded + consumes vigos.lib.mkProjectShell + preserved on upgrade) hold.

Note

Dependencies

Refs: #640

Add assets/workspace/flake.nix (minimal stub consuming the shared
toolchain as a flake input via vigos.lib.mkProjectShell + a placeholder
extraPackages) and assets/workspace/.envrc (use flake / nix-direnv), so a
downstream repo gets a working dev shell whose updates never overwrite
user files. Mark both never-overwrite in PRESERVE_FILES, un-ignore the
template .envrc (keeping .direnv/ and .envrc.local ignored), and broaden
the shellcheck exclude to .envrc at any path. Document the nix2container
production-image pattern (docs/NIX2CONTAINER.md) with a buildable example,
and add bats coverage for the stub + preservation.

Refs: #640
@c-vigo
c-vigo merged commit 2c0fd7f into feature/625-nix-claude-migration Jun 23, 2026
10 checks passed
@c-vigo
c-vigo deleted the feature/640-downstream-flake-stub branch June 23, 2026 19:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant