Repository navigation
feat(nix): downstream flake stub (non-overwriting) + nix2container pattern (#640) - #662
Merged
c-vigo merged 1 commit intoJun 23, 2026
Conversation
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
5 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
nix2containerproduction-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 placeholderextraPackagesblock (the user's, never overwritten).assets/workspace/.envrc—use flakevia nix-direnv (mirrors the root onboarding from T1.3 — direnv onboarding (nix-direnv) #633).flake.nix+.envrctoPRESERVE_FILESininit-workspace.sh(same class asjustfile.project). Reconciliation: the issue namedmanifest.toml/sync_manifest.py, but that path only mirrors repo→template and always overwrites — the actual scaffold-once guarantee for downstream user edits isPRESERVE_FILES(consulted by the--forceupgrade rsync). Also un-ignored the template.envrcinassets/workspace/.gitignore(keeping.direnv/+.envrc.localignored) and broadened the shellcheck exclude to.envrcat any path.nix2container—docs/NIX2CONTAINER.md+ a buildableexamples/nix2container-production/deriving a minimal runtime image from the same pinnednixpkgs(distinct from the devcontainer'sbuildLayeredImage). Future modular language shells noted as an opt-in extension point.Verified locally
devShells.defaultevaluates against the epic flake (--override-input vigos path:…→nix-shell).init-workspace.batsassertions (stub scaffolded + consumesvigos.lib.mkProjectShell+ preserved on upgrade) hold.Note
github:vig-os/devcontainer's new flake outputs (lib,overlays.default), which are on the epic; a full downstreamnix buildworks once [MASTER] Migrate devcontainer to a Nix toolchain + Claude-native setup #625 publishes to the default branch.Dependencies
Refs: #640