LinuxCommandLibrary

nixpkgs-review

tests Nix package changes by building affected packages

TLDR

Review pull request

$ nixpkgs-review pr [12345]
copy
Review with local checkout
$ nixpkgs-review rev HEAD
copy
Review specific commit
$ nixpkgs-review rev [abc123]
copy
Review with post-build report
$ nixpkgs-review pr [12345] --post-result
copy
Review allowing unfree packages
$ nixpkgs-review pr [12345] --allow-unfree
copy
Review with specified number of cores
$ nixpkgs-review pr [12345] --build-args "-j [4]"
copy
List failed builds
$ nixpkgs-review pr [12345] --print-result
copy

SYNOPSIS

nixpkgs-review [pr] [rev] [-p post-result] [options] target

DESCRIPTION

nixpkgs-review tests Nix package changes by building affected packages. It's essential for reviewing nixpkgs pull requests.
For pull requests, the tool checks out the PR, identifies changed packages, and builds them. Build failures indicate problems that need fixing before merge.
The review process compares the PR against the target branch. Only packages affected by changes are built, saving time on large contributions.
Post-result mode comments on GitHub PRs with build outcomes. This provides automated feedback to contributors and reviewers.
After builds complete, an interactive shell provides access to built packages for manual testing. Environment variables point to successful builds.
The tool handles unfree packages, cross-compilation targets, and parallel builds through configuration.

PARAMETERS

pr NUMBER

Review pull request by number.
rev COMMIT
Review specific revision.
wip
Review work in progress.
--post-result, -p
Post results to GitHub.
--allow-unfree
Build unfree packages.
--build-args ARGS
Arguments to pass to nix-build.
--print-result
Print build results.
--no-shell
Don't start shell after build.
-c PATH, --checkout PATH
Path to nixpkgs checkout.
--system SYSTEM
Target system.
--token TOKEN
GitHub token.

CAVEATS

Builds can take significant time and resources. Requires nix with flakes or nix-build. GitHub rate limits may affect PR fetching. Some packages may not build on all systems.

HISTORY

nixpkgs-review was developed by Jörg Thalheim (Mic92) to improve the nixpkgs review process. It automates what was previously a manual process of checking out PRs and building packages, significantly improving review efficiency.

SEE ALSO

> TERMINAL_GEAR

Curated for the Linux community

Copied to clipboard

> TERMINAL_GEAR

Curated for the Linux community