[Nix-dev] fetching tarballs recursively

Michael Raskin 7c6f434c at mail.ru
Fri May 30 09:54:58 CEST 2014


>Hi! I am managing an nixpkgs branch and this branch become more and
>more older. There already were issues where I had to change mirror
>urls because of missing sources. I'd like to store as much as possible
>into local repository in order to protect myself from such situations.
>Is there a way to recursively traverse nix expression tree and collect
>(and fetch) all the 'src' tarballs automatically?

It's relatively simple.

First, instantiate everything. Then find derivations (drv files) 
containing "md5" "sha1" or "sha256". Next, realise them: this will lead
to downloading everything.

For the benefit of future archive readers:

The commands to read about are:

nix-instantiate 
nix-store -r

Something similar is done in the script
https://github.com/NixOS/nix/blob/master/scripts/nix-reduce-build.in





More information about the nix-dev mailing list