[Nix-dev] importing nixpkgs from derivation dumps large path

Ganesh Sittampalam ganesh at earth.li
Fri Mar 3 23:00:45 CET 2017


On 02/03/2017 10:53, Eelco Dolstra wrote:

> On 03/02/2017 08:01 AM, Ganesh Sittampalam wrote:
> 
>> I guess that in this case the large tree is the import of the nixpkgs
>> tree. Is there any work around or better way to achieve what I want? 
> 
> Nix 1.12 has a builtin
> fetchgit function that allows you to say
> 
>   with import (builtins.fetchgit {
>     url = <nixpkgs>;
>     rev = "...";
>   }) {};
>   ...
> 
> (I just pushed a fix to allow "url" to refer to paths.)

Thanks! I've had a play with this, but it reruns the git fetch every
time, which takes a few seconds, nearly as long as the nixpkgs fetchgit
- I guess because no hash is specified?

I can see that this behaviour would also be useful in some cases as I
could just update the git ref live, but the evaluation time cost hurts
with what I'm currently trying to do.

Cheers,

Ganesh




More information about the nix-dev mailing list