[Nix-dev] NIX_PATH and tarballs

Nicolas Pierron nicolas.b.pierron at gmail.com
Sat Nov 21 13:23:44 CET 2015


Hi Daniel,

On Sat, Nov 21, 2015 at 10:58 AM, Daniel Hlynskyi
<abcz2.uprola at gmail.com> wrote:
> But when I run `nixos-rebuild` twice, I notice that tarball is not
> downloaded second time.
>
> root#
> NIX_PATH=nixos-config=/etc/nixos/configuration.nix:nixpkgs=https://github.com/NixOS/nixpkgs-channels/archive/nixos-unstable.tar.gz
> \
> root#   nixos-rebuild dry-build
> building the system configuration...
> # ----->  tarball is not downloaded second time <-----------
> these derivations will be built:
>   /nix/store/h2sp5p9x3gzryiq57znqdzc3jrw3dlpa-nixos-help.drv
>   /nix/store/9gzsm78klcassgs9yvpmnd38naczndc1-system-path.drv
>   /nix/store/rflgcrmas917yzdihxd9kqbp8n27w2qj-dbus-conf.drv
>
> What kind of caching is this and what happens when upstream tarball changes?

I asked Eelco a similar question, and Nix will check the meta data of
the file before any attempt to download it, if the meta data highlight
that the file is unchanged on the server, then Nix will not
re-download it.
Your browser does the same thing to avoid re-downloading resources as
long as it does not change on the server.

-- 
Nicolas Pierron
http://www.linkedin.com/in/nicolasbpierron - http://nbp.name/


More information about the nix-dev mailing list