Repository navigation
feat(nix): nix-direnv onboarding fast path - #652
Merged
Merged
Conversation
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
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 T1.3 (#633): switch the non-container onboarding fast path to nix-direnv.
.envrc— replaced bareuse flakewith 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..envrcself-bootstraps the pinned nix-direnv3.0.6library (SRI-verified) on firstdirenv allow, uses a user-installed copy from~/.config/direnv/direnvrcwhen present, and falls back to bareuse flakeif neither is available.docs/templates/CONTRIBUTE.md.j2— new "Nix dev shell (fast path)" onboarding section documenting clone →direnv allow, thevig-osCachix substituter (so the first allow is a binary fetch, not a from-source build), and enabling thenix-command/flakesexperimental features. RegeneratedCONTRIBUTE.mdwithjust 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).direnv allowloads the flake dev shell and creates the GC root.direnv/flake-profile -> /nix/store/...-nix-shell-env, confirming nix-direnv (not bareuse flake) is active. Hostnix.confalready carries thevig-osCachix substituter, so the closure is fetched from the public cache rather than built from source.Acceptance criteria
A clean clone +
direnv allowon 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)