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

Sam Thursfield ssssam at gmail.com
Sun Oct 25 01:40:13 CEST 2009


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?

Nix would need a few obvious extra features:
- svn/git/cvs in addition to fetchurl
- a way of specifying both a VC repo and tarball locations for a
module in the same file
- and a way for the user to specify what version of the module they
want installing.
- 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
- 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)
- more vicious garbage collection, since there would be lots more new
versions being installed
- and probably other things .. (including stuff like interactive error
handling to make the whole thing a bit more
  friendly as a build script)

The main benefits Nix would bring over jhbuild are:
- you wouldn't need any separate logic for the build script, it would
all be in the package management logic.
- substitution of binary packages. Instead of building all 100 (which
takes a LONG time on old PC's or on Windows) Nix could install most of
the dependencies from binary packages. Unless you run a bleeding-edge
distro, system packages are normally too old; for example, building
gtk+ from git often needs the last unstable release of glib. Nix
provides a nice way to satisfy this without (a) running an unstable
version of a core library or (b) building the whole of glib
- cleaner build environment and work environment
- slightly easier to test the new version of (for example) GNOME you
just build - it would just be a matter of switching profiles


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 ..
Thanks!
Sam



More information about the nix-dev mailing list