[Nix-dev] Import from derivation (was: Google Summer of Code 2017)

Shea Levy shea at shealevy.com
Sun Feb 5 17:26:45 CET 2017


Hi Peter,

Peter Simons <simons at nospf.cryp.to> writes:

> An obvious solution someone (probably Eelco) suggested was to split use of
> IFD into two steps: one builds the to-be-imported Nix files and the other
> one imports those expressions into the current package set:
>
>   myPackageExpr = callPackage ../build/nix/expression/for/haskell/packages {};
>   myPackage = import myPackageExpr;
>
> Now, Nix can evaluate "myPackageExpr" just fine -- it's a perfectly
> ordinary build process that creates a store path containing a Nix
> expression. Nix will refuse, however, to evaluate "myPackage" unless it
> has already built "myPackageExpr" or unless it can substitute that store
> path from a binary cache.
>
> Whenever the inputs of myPackageExpr change, Hydra compiles that store
> path and uploads it to cache.nixos.org, but it *won't* compile "myPackage"
> in the same evaluation. In the next evaluation, however, it will.
>
> IMHO, this is a pragmatic solution that should work well in practice. We
> just need someone to implement it.

This was my idea, and it was pretty much already implemented in https://github.com/NixOS/nix/pull/31

>
> Best regards,
> Peter
>
> _______________________________________________
> nix-dev mailing list
> nix-dev at lists.science.uu.nl
> http://lists.science.uu.nl/mailman/listinfo/nix-dev
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 832 bytes
Desc: not available
URL: <http://lists.science.uu.nl/pipermail/nix-dev/attachments/20170205/adcf6989/attachment.sig>


More information about the nix-dev mailing list