Repository navigation
fix(npins): don't pin inputs that follow another input (#140) - #141
Merged
Merged
Conversation
write-npins only skipped inputs with follows = "", so a nested follows such as flake-parts.inputs.nixpkgs-lib.follows = "nixpkgs" still pinned nixpkgs-lib via transitive discovery. Skip every name that sets follows, except names declared as pinnable top-level inputs (pins share one flat namespace). Adds test-npins-follows-other.
This was referenced Oct 12, 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.
Summary
Fixes #140.
write-npinsonly treated an input as "don't pin" when it setfollows = "". A follows to another input was ignored. For example,flake-parts.inputs.nixpkgs-lib.follows = "nixpkgs"had no effect, so transitive discovery still foundnixpkgs-libin flake-parts'flake.nixand pinned github:nix-community/nixpkgs.lib.The skip set now collects every name that sets
follows, at any nesting level, because such an input is never fetched under its own name. It subtracts names that are declared as pinnable top-level inputs. Pins share one flat namespace, and without that exceptiontest-npins-followswould lose its declared top-levelnixpkgs-lib. That test has a top-levelnixpkgs-liband alsoflake-parts.inputs.nixpkgs-lib.follows = "nixpkgs-lib".Behaviour change: a nested
x.follows = ""used to suppress the pin even when a top-levelxwas declared. Now the declared top-levelxkeeps its pin.Validation
test-npins-follows-other(the writer downloads nixpkgs-lib ignoring follows #140 shape). It fails on main, wheresources.jsongets anixpkgs-libpin, and passes with this change.test-npins-follows,test-npins-skip,test-npins-transitiveandtest-npinspass.test-allwas not run locally.