You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Solene Rapenne edfbbead39 name in LICENSE 5 months ago
LICENSE name in LICENSE 5 months ago README: PR got merged, still mention it for older nixpkgs 5 months ago nix-instantiate can be used to replace nix-instantiate + nix-build 7 months ago nixpkgs should be the one provided in the command line 7 months ago


The point of this script is to allow users to locally download all sources required to build a given Nix package.

The script relies on internal Nixpkgs tools that will download the sources in the nix store and verify the checksum.

If you run it multiple times, nothing more will be downloaded but it takes a bit of time to ensure each file is in the store.

Avoiding garbage collector

Files will be downloaded into the nix store, and linked into a newly created directory distfiles relative to your current location.

The link prevents the files to be garbage collected.

How to use

To download sources required to build git:

./ git kakoune | ./

To download sources required to build git and mercurial:

./ git mercurial | ./

To download sources required to build git using a different nixpkgs:

./ -f /path/to/nixpkgs/ git | ./

Internal details

The command is printing a JSON file on stdout containing each source information such as url, checksum value, checksum type, filename.

The command is reads a JSON structure on the standard input and will loop over each item.

By using this design, you can craft JSON files with custom scripts, and feed them to


Patches files weren't included before the merge of , so if you want to run it on older nixpkgs versions, you won't have the patches files, the diff is trivial to be applied though.