[Nix-dev] "live builds" proposal

Yury G. Kudryashov urkud+nix at ya.ru
Sun Aug 1 01:20:28 CEST 2010


Hi!

I propose the following extension to the nix language that will allow native 
support for "live scm builds" etc.

If nix is called with --enable-exec, the new function builtins.exec is 
added. The proposed syntax is like the following:

src =
  if builtins ? exec then
    # fetch to ~/.nix-checkouts/name
    builtins.exec [ "nix-prefetch-svn" .... ];
    builtins.filterSource "~/.nix-checkouts/name"
  else if pathExists "~/.nix-checkouts/name" then
    builtins.filterSource ...
  else
    fetchsvn { # url and hash for some specific revision
    };

Of course, all this logic should be hidden in new fetchsvn/fetchgit etc. 
functions.

The main drawback of this solution is that the result of a nix expression 
will depend on some things outside of the nix expression. That's why I 
propose to enable this builtin only if nix is called with --enable-exec: if 
you want to rebuild your system from the configuration written a year ago, 
just do not add --enable-exec.




More information about the nix-dev mailing list