[Nix-dev] Nix as a build script for developers

Michael Raskin 7c6f434c at mail.ru
Sun Oct 25 07:20:30 CET 2009


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Sam Thursfield wrote:
> Hi!
> I've just found out about Nix and I think its a very interesting
> project. Straight away it gave me an idea (and apologies if this has
> been mentioned before; I did do a search in the archives first): ..
> Since Nix can build packages from source, does anyone think it would
> be neat to use it as a replacement for complex build scripts, like
> GNOME's jhbuild?

We have thought of it, but never discussed in details.

> Nix would need a few obvious extra features:
> - svn/git/cvs in addition to fetchurl

Which exists

> - a way of specifying both a VC repo and tarball locations for a
> module in the same file

Which is possible, because Nix is Turing-complete.

> - and a way for the user to specify what version of the module they
> want installing.

Which can be done by filling in options in a Nix expression right now.

> - the ability to maintain and build modules from directories in the
> user's search tree, so they could hack on them and then install them

Which means simply overriding src with a local path.

> - a way to make the built code more permanent (could put it in a
> build/ directory in the source tree or just in the
>   source tree, as per taste)

Which is called GC roots in Nix.

> - more vicious garbage collection, since there would be lots more new
> versions being installed

Sorry? You mean it should be optimised for some use cases?

> - and probably other things .. (including stuff like interactive error
> handling to make the whole thing a bit more
>   friendly as a build script)

Which is lacking, but should be done as wrappers, not core functionality.

> Anyway, this seems like a fair amount of work and jhbuild does the job
> fairly well, so I'm not going to cancel my weekend to start work on
> this. I'd really just like to hear from knowledgeable people on
> whether they think this is an interesting possibility or whether I am
> totally on crack ..

Actually, if you are starting a small (but menacing to become
medium-sized just on its way to big..) project, you could use Nix as a
build script right now if you have any experience with Nix as a package
manager. Using Nix as build script is way easier than understanding
NixOS modules..
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.12 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQEcBAEBAgAGBQJK4+4tAAoJEE6tnN0aWvw3rrcIALpass7AEaoigLONOFy1pSbi
isCQZNFXOdz7QalH/4+ImKM30b3UM5wxL61kLm52Z8ET5gl5J/TEtw7J5LIS49E1
GFjJPY3IFb7Ag/HY4CrcPkmBrlUuFynMluCS0RAcklg1k08RLM6RY3K8YU2h3Xw/
PpVfvmdcaKomhZb5EFMrrUL+1HAMe0fr7gz2PYD2kozGkx2yw3A7H+XIu8h7JnXP
uatdC1QaM7979f4Y2GJFCOTUtcevpObty6P8fMYS01pAe/aKKcqznXxhfv8WCS2L
+ecEK6IwrwCaN7W/OD3/+7SYkWU1sdHILEJhd5nsnp7avHxMoCSjpNdneWuUyvw=
=DjCI
-----END PGP SIGNATURE-----



More information about the nix-dev mailing list