Skip to content

feat(nix): nix-direnv onboarding fast path - #652

Merged
c-vigo merged 1 commit into
feature/625-nix-claude-migrationfrom
feature/633-direnv
Jun 23, 2026
Merged

c-vigo merged 1 commit into
feature/625-nix-claude-migrationfrom
feature/633-direnv

Conversation

@c-vigo

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

Copy link
Copy Markdown
Contributor

Summary

Implements T1.3 (#633): switch the non-container onboarding fast path to nix-direnv.

  • .envrc — replaced bare use flake with nix-direnv. The dev-shell evaluation is now GC-rooted and cached under .direnv/ (already gitignored), so re-entering the directory is instant and the closure is never garbage-collected. .envrc self-bootstraps the pinned nix-direnv 3.0.6 library (SRI-verified) on first direnv allow, uses a user-installed copy from ~/.config/direnv/direnvrc when present, and falls back to bare use flake if neither is available.
  • docs/templates/CONTRIBUTE.md.j2 — new "Nix dev shell (fast path)" onboarding section documenting clone → direnv allow, the vig-os Cachix substituter (so the first allow is a binary fetch, not a from-source build), and enabling the nix-command/flakes experimental features. Regenerated CONTRIBUTE.md with just docs. This folds in [DOCS] Consolidated docs/NIX.md (flake architecture + onboarding) #255.
  • CHANGELOG.md — ## Unreleased → Added entry.

Edits are localized to the onboarding/direnv section to keep a trivial merge with T3.2 (#638), which also touches CONTRIBUTE.md.

Verification

  • just precommit — green (all hooks pass).
  • just docs — clean / idempotent (no diff on re-run).
  • nix-direnv validated on host (direnv 2.32.1, nix 2.34.7): direnv allow loads the flake dev shell and creates the GC root .direnv/flake-profile -> /nix/store/...-nix-shell-env, confirming nix-direnv (not bare use flake) is active. Host nix.conf already carries the vig-os Cachix substituter, so the closure is fetched from the public cache rather than built from source.

Acceptance criteria

A clean clone + direnv allow on a warm Cachix cache yields a working shell in seconds (documented in CONTRIBUTE.md; the substituter avoids a from-source build on first allow). Verified the GC-rooting mechanism works locally.

Refs: #633 (folds in #255)

Switch .envrc from bare `use flake` to nix-direnv so the dev-shell
evaluation is GC-rooted and cached under .direnv/, making re-entry
instant and protecting the closure from garbage collection. nix-direnv
self-bootstraps on first `direnv allow` and falls back to bare
`use flake` when unavailable.

Document the clone -> `direnv allow` onboarding flow, the vig-os Cachix
substituter (binary fetch instead of from-source build on first allow),
and enabling the nix-command/flakes experimental features in the
CONTRIBUTE.md.j2 source template; regenerate with `just docs`. Folds in
the Nix-flake-as-alternative-dev-setup documentation request.

Refs: #633
@c-vigo
c-vigo marked this pull request as ready for review June 23, 2026 11:51
@c-vigo
c-vigo merged commit 23a3bf2 into feature/625-nix-claude-migration Jun 23, 2026
10 checks passed
@c-vigo
c-vigo deleted the feature/633-direnv branch June 23, 2026 11:51
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