[Nix-dev] Dynamic Dependency Management by Calling External Programs from Nix

Peter Simons simons at cryp.to
Wed Oct 26 19:19:26 CEST 2011


Hi Shea,

 > runCommand runs a command at _realisation_ time: you're already in a
 > builder, and you can't use the outputs of the command you ran in a nix
 > expression itself.

thank you very much for the clarification.


 > builtins.exec, on the other hand, would run at _instantiation_ time.
 > So you can use the outputs in a nix expression, and in particular to
 > create derivations on-the-fly.

If used with caution, that would be a very useful feature indeed.


 > That being said, I much prefer the builtins.readFile extension over
 > builtins.exec.

It seems to me, though, that 'exec' is strictly more powerful than
'readFile', right? One could implement readFile using exec, but that is
not true the other way round. Why do you prefer readFile?

Take care,
Peter



More information about the nix-dev mailing list