Repository navigation
fix(init-workspace): warn on scaffold/flake-pin version skew - #1101
Merged
Merged
Conversation
During a --force direnv/both upgrade, compare the pinned `vigos` flake ref in the consumer's flake.nix against the DEVKIT_VERSION being written. When a pin exists and differs, print a non-fatal warning: the scaffold and the flake input ship coupled halves of the same change (e.g. #1053's JSONC banner + its check-json exclude), so update `vigos.url` to the target ref and run `nix flake update vigos`. A floating (unpinned) input or a matching pin stays silent. flake.nix is a PRESERVE_FILE, so we warn rather than rewrite it. Refs: #1093
This was referenced Jul 15, 2026
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.
Closes #1093. Part of #1096.
Problem
For direnv/flake consumers, two coupled halves of a change ship from different version vehicles: the scaffold (
.vig-osDEVKIT_VERSION) writes files, while the pinnedvigosflake input delivers the hook behavior innix/hooks.nixthat acts on them (e.g. the #1053check-jsonexclude paired with a scaffold-written JSONC banner). A consumer who bumps only the scaffold but leaves the pinned flakerefbehind gets, e.g., the banner without its exclude → every commit fails, with nothing warning about the skew.Change (warn-only — no auto-edit of the preserved
flake.nix)install.sh --forcenow detects and warns when the pinnedvigos.url = "…?ref=<X>"inflake.nixdiffers from the targetDEVKIT_VERSION, telling the user to update the pin and runnix flake update vigos. Gated on force + direnv/both + a pin that exists and differs; a floating (unpinned) input and a matching pin are both silent. Non-fatal.docs/MIGRATION.md: new subsection documenting the lockstep invariant (why the two must move together, and how).Tests / verification
3 new bats cases (skew warns; match silent; floating silent) — RED before, GREEN after. Handles the
set -euo pipefailgrep-exit-1 trap. Fullprek run --all-filesgreen locally.Merge note
Re-merged onto
dev(conflict-free; its changelogAddedentry auto-merged). Siblings #1092 and #1099 also touchCHANGELOG.md— a later merge may need "Update branch".