Nvfetcher: generate nix sources expr for the latest version of packages

There are already a few tools for automating nix packages updates, and nvfetcher is a kind of yet another tool for this. But unlike some of those tools, nvfetcher is

  • non-intrusive - it generates a nix source expr file that can be “injected” into packages drvs, rather than rewriting something.
  • flexible - “how to track the version update of a package” and “how to fetch a package” are not correlated, so we are free to make arbitrary combinations of package source and fetcher.
  • powerful - with the help of nvchecker, which supports exhaustive upstream version sources, e.g. github release, git commit, and pypi release, etc., nvfetcher is able to track many kinds of version updates and prefetch them.
  • fast - nvfetcher is buit on the top of shake, which means that it has some basic properties of a build system, such as never build one thing more than once.

It can be configured by either a TOML file or a eDSL language in Haskell, where the later one is much powerful. Base on shake, the internal structure of nvfetcher is very extensible, with many components decoupled. It might not be mature yet as a new-born tool, but I believe it won’t be hard to add some features which we don’t yet have.

8 Likes

Any buildGoModule support? To update vendorSha256.

No, at least so far. It’s not clear how to calculate vendorSha256 without instantiating buildGoModule, which is not yet available when we run nvfetcher. Unlike nix-prefetch, nvfetcher generates the sources.nix from scratch, so it has no chance to touch drvs that actually “build” packages.

For Rust, NixOS/nixpkgs#122158 kind of solved this issue recently, where cargoSha256 was opt-out and cargoLock can be calculated out of buildRustPackage, so nvfetcher can support this. I don’t know if it’s possible for Go to have the similar process.

1 Like

An attempt in building importCargoLock like infrastructure for go. Not feasible yet, dozens of IFDs, downloading the same zip file for thousands of times. But anyway it’s working. ¯_(ツ)_/¯

1 Like