Repository navigation
feat(scripts): install/init delivery-mode picker — devcontainer|direnv|both (#641) - #663
Merged
c-vigo merged 4 commits intoJun 23, 2026
Merged
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
Add a --mode devcontainer|direnv|both selector to install.sh and assets/init-workspace.sh. install.sh validates the flag (accepting --mode X and --mode=X) and passes it through; init-workspace.sh prompts for the mode interactively (default both) or defaults to both under --no-prompts, then prunes the scaffold: devcontainer removes the flake.nix + .envrc stub, direnv removes the .devcontainer/ scaffold, both keeps everything. Document the flag and prompt in README and CONTRIBUTE, add per-mode and wiring bats tests. Refs: #641
The delivery-mode prompt blocked the non-interactive integration test (no --no-prompts, env-derived name/org skip the other prompts, but the mode prompt had no escape). Default to both when stdin is not a TTY, so CI / piped runs never block on the prompt. Refs: #641
…t fixture The pexpect interactive-init fixture drives init-workspace.sh through a PTY, so the new mode picker prompts; answer it with "both" (after the org prompt, before file copy) to keep the full scaffold and the existing downstream-structure assertions valid. Refs: #641
4 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.3 (#641): users choose how the dev environment is delivered.
install.sh+assets/init-workspace.shgain a--mode devcontainer|direnv|bothflag (both--mode Xand--mode=X), validated up front. When unset: interactive prompt (default both); under--no-prompts/--smoke-test, defaults to both (preserves prior behaviour).devcontainer→.devcontainer/only (removesflake.nix+.envrc)direnv→flake.nix+.envrconly (removes.devcontainer/)both→ everythingREADME.md+CONTRIBUTE.md(via.j2templates) document the flag, default, and prompt copy.Verified (by the implementing run)
shellcheck install.sh assets/init-workspace.shclean.bats tests/bats/init-workspace.bats→ 38/38 pass (7 new: per-mode file-set assertions on a template copy + wiring asserts).install.sh --dry-runmode validation/pass-through.Notes
nix2containerproduction builder #640 (the flake stub it prunes): until T4.2 — Downstream pattern: minimal flake stub (non-overwriting) +nix2containerproduction builder #640 merges into the epic, this PR's diff shows T4.2 — Downstream pattern: minimal flake stub (non-overwriting) +nix2containerproduction builder #640's commit too. Merge order: T4.2 — Downstream pattern: minimal flake stub (non-overwriting) +nix2containerproduction builder #640 → T4.3 — Install/init UX: choose devcontainer / direnv / both #641.Dependencies
nix2containerproduction builder #640. Blocks: none.Refs: #641