Skip to content

feat(scripts): install/init delivery-mode picker — devcontainer|direnv|both (#641) - #663

Merged
c-vigo merged 4 commits into
feature/625-nix-claude-migrationfrom
feature/641-install-picker
Jun 23, 2026
Merged

c-vigo merged 4 commits into
feature/625-nix-claude-migrationfrom
feature/641-install-picker

Conversation

@c-vigo

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

Copy link
Copy Markdown
Contributor

Summary

Implements T4.3 (#641): users choose how the dev environment is delivered.

  • install.sh + assets/init-workspace.sh gain a --mode devcontainer|direnv|both flag (both --mode X and --mode=X), validated up front. When unset: interactive prompt (default both); under --no-prompts/--smoke-test, defaults to both (preserves prior behaviour).
  • Prune after rsync (scoped to the workspace, idempotent):
    • devcontainer → .devcontainer/ only (removes flake.nix + .envrc)
    • direnv → flake.nix + .envrc only (removes .devcontainer/)
    • both → everything
  • Docs: README.md + CONTRIBUTE.md (via .j2 templates) document the flag, default, and prompt copy.

Verified (by the implementing run)

  • shellcheck install.sh assets/init-workspace.sh clean.
  • bats tests/bats/init-workspace.bats → 38/38 pass (7 new: per-mode file-set assertions on a template copy + wiring asserts).
  • Manual prune simulation per mode + install.sh --dry-run mode validation/pass-through.

Notes

Dependencies

Refs: #641

c-vigo added 4 commits June 23, 2026 20:20
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
@c-vigo
c-vigo merged commit f686b56 into feature/625-nix-claude-migration Jun 23, 2026
10 checks passed
@c-vigo
c-vigo deleted the feature/641-install-picker branch June 23, 2026 19:23
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