nixpkgs-update: Tool for semi-automatic updating of nixpkgs repository

[ library, program, web ] [ Propose Tags ]

nixpkgs-update provides tools for updating of nixpkgs packages in a semi-automatic way. Mainly, it is used to run the GitHub bot @r-ryantm, but the underlying update mechanisms should be generally useful and in a later version should be exposed as a command-line tool.

[Skip to Readme]


Maintainer's Corner

For package maintainers and hackage trustees


Versions [RSS] 0.2.0, 0.3.0
Dependencies aeson, base (>=4.13 && <5), bytestring, conduit, containers, cryptohash-sha256, directory, errors, filepath, github, http-client, http-client-tls, http-conduit, http-types, iso8601-time, lifted-base, mtl, neat-interpolation, nixpkgs-update, optparse-applicative, parsec, parsers, partial-order, polysemy, polysemy-plugin, regex-applicative-text, servant, servant-client, sqlite-simple, template-haskell, temporary, text, th-env, time, transformers, typed-process, unix, unordered-containers, vector, versions, xdg-basedir, zlib [details]
License CC0-1.0
Copyright 2018-2020 Ryan Mulligan et al.
Author Ryan Mulligan et al.
Category Web
Home page
Bug tracker
Source repo head: git clone
Uploaded by ryantm at 2021-08-25T01:52:59Z
Distributions NixOS:0.3.0
Executables nixpkgs-update
Downloads 652 total (12 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs available [build log]
Last success reported on 2021-08-25 [all 1 reports]

Readme for nixpkgs-update-0.3.0

[back to package description]


Build Status Patreon

The future is here; let's evenly distribute it!



The nixpkgs-update mission is to make nixpkgs the most up-to-date repository of software in the world by the most ridiculous margin possible. Here's how we are doing so far.

It provides an interactive tool for automating single package updates. Given a package name, old version, and new version, it updates the version, and fetcher hashes, makes a commit, and optionally a pull request. Along the way, it does checks to make sure the update has a baseline quality.

It is the code used by the GitHub bot @r-ryantm to automatically update nixpkgs. It uses package repository information from, the GitHub releases API, and PyPI to generate a lists of outdated packages.


For the Cachix cache to work, your user must be in the trusted-users list or you can use sudo since root is effectively trusted.

Run without installing:

nix run \
  --option extra-substituters '' \
  --option trusted-public-keys '' \
  -f \
  -c nixpkgs-update --help

Install into your Nix profile:

nix-env \
  --option extra-substituters '' \
  --option trusted-public-keys '' \

Declaratively with niv:

niv add ryantm/nixpkgs-update

NixOS config with Niv:

  sources = import ./nix/sources.nix;
  nixpkgs-update = import sources.nixpkgs-update {};
  environment.systemPackages = [ nixpkgs-update ];

home-manager config with Niv:

  sources = import ./nix/sources.nix;
  nixpkgs-update = import sources.nixpkgs-update {};
  home.packages = [ nixpkgs-update ];

Interactive updates

nixpkgs-update supports interactive, single package updates via the update subcommand.

Update tutorial

  1. Setup hub and give it your GitHub credentials, so it saves an oauth token. This allows nixpkgs-update to query the GitHub API.
  2. Go to your local checkout of nixpkgs, and make sure the working directory is clean. Be on a branch you are okay committing to.
  3. Run it like: nixpkgs-update update "postman 7.20.0 7.21.2" which mean update the package "postman" from version 7.20.0 to version 7.21.2.
  4. It will run the updater, and, if the update builds, it will commit the update and output a message you could use for a pull request.


  • --cve—adds CVE vulnerability reporting to the PR message. On first invocation with this option, a CVE database is built. Subsequent invocations will be much faster.
  • --nixpkgs-review—runs nixpkgs-review, which tries to build all the packages that depend on the one being updated and adds a report.

Batch updates

nixpkgs-update supports batch updates via the update-list subcommand.

Update-List tutorial

  1. Setup hub and give it your GitHub credentials, so it saves an oauth token. This allows nixpkgs-update to query the GitHub API.

  2. Clone this repository and build nixpkgs-update:

    git clone && cd nixpkgs-update
  3. To test your config, try to update a single package, like this:

    ./result/bin/nixpkgs-update update "pkg oldVer newVer update-page"`
    # Example:
    ./result/bin/nixpkgs-update update "tflint 0.15.0 0.15.1"`

    replacing tflint with the attribute name of the package you actually want to update, and the old version and new version accordingly.

    If this works, you are now setup to hack on nixpkgs-update! If you run it with --pr, it will actually send a pull request, which looks like this:

  4. If you'd like to send a batch of updates, get a list of outdated packages and place them in a packages-to-update.txt file:

./result/bin/nixpkgs-update fetch-repology > packages-to-update.txt

There also exist alternative sources of updates, these include:

  1. Run the tool in batch mode with update-list:
./result/bin/nixpkgs-update update-list


Some of these features only apply to the update-list sub-command or to features only available to the @r-ryantm bot.


A number of checks are performed to help nixpkgs maintainers gauge the likelihood that an update was successful. All the binaries are run with various flags to see if they have a zero exit code and output the new version number. The outpath directory tree is searched for files containing the new version number. A directory tree and disk usage listing is provided.

Security report

Information from the National Vulnerability Database maintained by NIST is compared against the current and updated package version. The nixpkgs package name is matched with the Common Platform Enumeration vendor, product, edition, software edition, and target software fields to find candidate Common Vulnerabilities and Exposures (CVEs). The CVEs are filtered by the matching the current and updated versions with the CVE version ranges.

The general philosophy of the CVE search is to avoid false negatives, which means we expect to generate many false positives. The false positives can be carefully removed by manually created rules implemented in the filter function in the NVDRules module.

If there are no CVE matches, the report is not shown. The report has three parts: CVEs resolved by this update, CVEs introduced by this update, and CVEs present in both version.

If you would like to report a problem with the security report, please use the nixpkgs-update GitHub issues.

The initial development of the security report was made possible by a partnership with Serokell and the NLNet Foundation through their Next Generation Internet Zero Discovery initiative (NGI0 Discovery). NGI0 Discovery is made possible with financial support from the European Commission.

Rebuild report

The PRs made by nixpkgs-update say what packages need to be rebuilt if the pull request is merged. This uses the same mechanism OfBorg uses to put rebuild labels on PRs. Not limited by labels, it can report the exact number of rebuilds and list some of the attrpaths that would need to be rebuilt.

PRs against staging

If a PR merge would cause more than 100 packages to be rebuilt, the PR is made against staging.


Logs from r-ryantm's runs are available online. There are a lot of packages nixpkgs-update currently has no hope of updating. Please dredge the logs to find out why your pet package is not receiving updates.


By uploading the build outputs to Cachix, nixpkgs-update allows you to test a package with one command.


Incremental development:

nix-shell --run "cabal v2-repl"

Run the tests:

nix-shell --run "cabal v2-test"

Run a type checker in the background for quicker type checking feedback:

nix-shell --run "ghcid"

Run a type checker for the app code:

nix-shell --run 'ghcid -c "cabal v2-repl exe:nixpkgs-update"'

Run a type checker for the test code:

nix-shell --run 'ghcid -c "cabal v2-repl tests"'

Updating the Cabal file when adding new dependencies or options:

nix run nixpkgs.haskellPackages.hpack -c hpack

Source files are formatted with Ormolu.

There is also a Cachix cache available for the dependencies of this program.