Repository navigation
feat: add lon and niv writers on a shared pin engine (#95) - #143
Merged
Merged
Conversation
Move the npins writer's URL parsing, transitive discovery, follows skip set and pruning into modules/pins (queue.bash + flake-file.pinWriter). npins, lon and niv become small backends. Add flakeModules.lon and flakeModules.niv (write-lon, write-niv), wire both into write-lock and bootstrap, document them, and add bootstrap tests.
Member
|
Amazing, @sini, thanks for updating also the docs. |
Member
|
Smart move on making the script re-usable across *pin libs. |
vic
approved these changes
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
Closes #95. Adds lon and niv writers, so flake-file now writes lock files for every with-inputs loader except nixtamal (see below).
flakeModules.lonexposeswrite-lon, which writeslon.nixandlon.lock.flakeModules.nivexposeswrite-niv, which writesnix/sources.jsonandnix/sources.nix, created withniv init --no-nixpkgs.write-lock(detected bylon.lock/nix/sources.json) and into the bootstrap app.Shared engine instead of a copy. The npins writer's logic (URL scheme parsing, branch fallback, transitive discovery from GitHub
flake.nix, thefollowsskip set from #141, and pruning unreached pins) moved tomodules/pins/. It now has aqueue.bashand aflake-file.pinWriterbuilder. A backend is a small script definingpin_init,pin_names,pin_exists,pin_remove,pin_github,pin_gitlab,pin_git,pin_channelandpin_tarball. npins, lon and niv are each about ten lines (modules/{npins,lon,niv}/*.bash). lon and niv have no channel or gitlab kinds, so they map channels and plain URLs totarballsources and gitlab togit.npins behaviour is unchanged, except that a bare git URL now gets the same main/master fallback as
git+URLs.nixtamal is not included. It has no
addcommand; its manifest is KDL edited by hand. A writer would need a manifest serializer like tack'spins.toml, so it would be a follow-up.Validation
test-lonandtest-niv(pin a declared input; niv adds no default nixpkgs)test-lon-follows-otherandtest-niv-follows-other(the writer downloads nixpkgs-lib ignoring follows #140 shape: flake-parts'nixpkgs-libfollowsnixpkgsand is not pinned)test-write-lock-lonandtest-write-lock-nivtest-npins,-follows,-follows-other,-skip,-transitive,-schemes,test-write-lock-npins.from.lonandfrom.nivon the*-follows-otheroutputs both resolve inputs[ flake-parts nixpkgs ]with real sources.nix run ./dev#fmt -- --ciis clean.test-allwas not run locally.