Skip to content

fix(install): scaffold direnv mode on the host without a container - #1873

Merged
gerchowl merged 5 commits into
devfrom
bugfix/1871-direnv-upgrade-nix
Oct 12, 2026
Merged

gerchowl merged 5 commits into
devfrom
bugfix/1871-direnv-upgrade-nix

Conversation

@gerchowl

@gerchowl gerchowl commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

Summary

In direnv mode install.sh (fresh scaffold and --force upgrade) and devkit-upgrade.yml no longer need docker/podman. install.sh skips runtime detection and runs the pinned init-workspace.sh on the host from the devkit flake source (nix flake metadata -> assets/, image bake steps replayed, scratch dir removed) — the same replay as the #1870 drift check. devkit-upgrade.yml drops --docker when .vig-os says DEVKIT_MODE=direnv. devcontainer/both/bare keep the image path unchanged.

  • direnv mode is taken from --mode direnv or the persisted DEVKIT_MODE; it requires an exact --version <tag> (latest is refused) and nix, jq and rsync on PATH.
  • Files are created as the invoking user, so the ownership-repair container step is skipped.
  • Known limitation: the installer comes from the target release tag, so a repo's automated upgrade becomes container-free once its target release ships this install.sh.

Proof

Container-free run with docker/podman absent from PATH, in a scratch repo with DEVKIT_MODE=direnv: install.sh --version 1.18.0 scaffolded the workspace; after committing, --force left git status clean. Tests: tests/test_install_direnv_host.py (dry-run plans, container modes unchanged, executed scaffold + upgrade with docker/podman stubs that fail on any call, latest refusal) and tests/test_workflow_devkit_upgrade.py.

Refs: #1871

Cost and coverage notes

  • nix develop of the pinned release adds about 3.8 s warm (1.18.0, store populated; measured once). A cold run additionally fetches the dev-shell closure from the binary cache and was not measured.
  • The direnv smoke lane now installs Nix before the scaffold, so the release gate no longer runs the toolchain composite's install-nix branch; consumer CI on hosted runners still does.

install.sh in direnv mode skips docker/podman detection and runs the
pinned init-workspace.sh from the devkit flake source (nix flake
metadata -> assets/, image bake steps replayed), like the drift check.
devkit-upgrade.yml drops --docker for direnv repos. Container modes are
unchanged.

Refs: #1871
direnv mode no longer touches a runtime (#1871), so the stubbed-runtime
bats cases use --mode both, the dry-run image cases use a fresh target,
and the direnv entrypoint case runs the host scaffold with nix stubbed.

Refs: #1871
direnv mode defaults the version to the .vig-os pin or the newest release
tag, runs init-workspace.sh inside the release's dev-shell with a clean
environment (macOS-safe), and ignores --docker/--podman with a warning.
The direnv smoke lane installs Nix first and drops the container
workarounds.

Refs: #1871
… nix

Run nix develop from the scratch dir so its hooks never touch the caller's
repo, pass the job token to nix in devkit-upgrade.yml, and note the pin
behaviour of a direnv --force in the README.

Refs: #1871
@gerchowl
gerchowl merged commit 4f3ac77 into dev Oct 12, 2026
16 checks passed
@gerchowl
gerchowl deleted the bugfix/1871-direnv-upgrade-nix branch October 12, 2026 12:32
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