- Zig 69.4%
- Nix 30.6%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
|
All checks were successful
test / test (push) Successful in 14m58s
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01AFs1WgXzf6dcNA26rYWZSR |
||
| .forgejo/workflows | ||
| assets | ||
| LICENSES | ||
| src | ||
| .gitignore | ||
| .pinact.yaml | ||
| build.zig | ||
| build.zig.zon | ||
| build.zig.zon.nix | ||
| flake.lock | ||
| flake.nix | ||
| LICENSE | ||
| package.nix | ||
| README.md | ||
| REUSE.toml | ||
nix-track-pr
A command-line tool that follows nixpkgs pull requests through the branches they flow into, showing which branches and channels each merged pull request has reached so far.
Usage
$ nix-track-pr 400000 '#401234'
Give it one or more pull request numbers, with or without a leading #.
--version prints the version.
For each pull request, gh pr view supplies the title, the state, the base
branch and the merge commit. The base branch decides which branches are
checked, following the branch conventions in the nixpkgs contributing guide:
| Base branch | Branches checked |
|---|---|
master |
master, nixos-unstable-small, nixpkgs-unstable, nixos-unstable |
staging-next |
staging-next, then everything master gets |
staging |
staging, staging-next, then everything master gets |
release-YY.MM |
release-YY.MM, nixpkgs-YY.MM-darwin, nixos-YY.MM-small, nixos-YY.MM |
Those branches are fetched into a local bare clone of nixpkgs, and
git merge-base --is-ancestor decides whether each one contains the merge
commit. The results are drawn as a table, one block per pull request.
Requirements
gh and git must be available. gh must be logged in, since it talks to the
GitHub API. Build options set the paths to both programs (-Dgh= and
-Dgit=); the Nix package points them at the store paths, so it needs nothing
on PATH.
The first run makes a bare clone of nixpkgs, which takes around 6 GB of disk space and many minutes. Later runs only fetch the branches they need, which is quick unless it has been a long time since the last run.
Cache directory
The clone lives in nix-track-pr/nixpkgs inside the platform's cache
directory, which known-folders
finds:
| Platform | Cache directory |
|---|---|
| Linux and other Unix | $XDG_CACHE_HOME, or ~/.cache if that is not set |
| macOS | ~/Library/Caches |
| Windows | %LOCALAPPDATA% |
The directory is created if it does not exist.
Building
The project is written in Zig 0.17. Nixpkgs does not package that version yet,
so the flake takes the release build from
zig-overlay. The flake builds for
x86_64-linux, aarch64-linux and aarch64-darwin, the systems the overlay
packages.
$ nix build # the package, in ./result
$ nix develop -c zig build # a debug build, in ./zig-out
$ nix develop -c zig build test # the tests
The Nix build has no network, so the Zig dependencies are fetched by Nix from
build.zig.zon.nix, which zon2nix
generates from build.zig.zon. Regenerate it whenever a dependency changes:
$ nix develop -c zon2nix --17 --nix=build.zig.zon.nix build.zig.zon
The last version that builds with Zig 0.16 is tagged v0.3.0, and lives on
the zig-0.16 branch.
Where this lives
The repository lives in three places that carry the same history. The Forgejo instance at https://git.jcollie.dev/jeff/nix-track-pr is the web-visible one:
$ git clone https://git.jcollie.dev/jeff/nix-track-pr.git
it is mirrored on Tangled at https://tangled.org/jcollie.dev/nix-track-pr, and it is also on the Radicle network, where the repository's identifier is
rad:z2qXwUZNDW57q9KahiRR9KnXSRmSb
and rad clone rad:z2qXwUZNDW57q9KahiRR9KnXSRmSb fetches it from any node
that seeds it. Any of the three is the whole project.
License
MIT. The project follows the REUSE specification,
and reuse lint passes.
References cited
- freedesktop.org. XDG Base Directory Specification. Version 0.8. https://specifications.freedesktop.org/basedir-spec/latest/.
- Git Project. "git-merge-base Documentation." Git. https://git-scm.com/docs/git-merge-base. Accessed October 3, 2026.
- GitHub. "gh pr view." GitHub CLI Manual. https://cli.github.com/manual/gh_pr_view. Accessed October 3, 2026.
- NixOS Contributors. "Contributing to Nixpkgs." GitHub. https://github.com/NixOS/nixpkgs/blob/master/CONTRIBUTING.md. Accessed October 3, 2026.
- ziglibs contributors. known-folders. Zig. https://github.com/ziglibs/known-folders. Accessed October 3, 2026.
- Zig Software Foundation. "Zig Language Reference 0.17.0." Zig Programming Language. https://ziglang.org/documentation/0.17.0/. Accessed October 3, 2026.
