[Nix-dev] nix-env -i improvements

Eelco Dolstra eelco at cs.uu.nl
Thu Jan 26 16:12:33 CET 2006


On Thu, 26 Jan 2006 15:54:17 +0100
Armijn Hemel <armijn at uulug.nl> wrote:

> nix-env keeps being a pain in the neck when used for installing packages.
> If I install for example subversion using nix-env -i, it wants to install
> 3 versions, when I install findutils it wants to install 2 version (one
> original, one wrapper so it can find the right locate database and such).

This is only the case when you install from all-packages-generic.nix, not
from populate-cache.nix (which is the default Nix expression for the
nixpkgs channel).

If you have multiple packages with the same symbolic name, then you're
going to have trouble telling them apart.

Incidentally nix-env does have a way to deal with this: instead of
selecting the package to install by name, you can also specify an
expression that selects the package.  This is unambiguous.  For instance,
instead of saying "nix-env -i subversion" (which selects by name), you
can also do:

  nix-env -f .../i686-linux.nix -E "x: x.subversion"

or

  nix-env -f .../i686-linux.nix -E "x: x.subversionWithJava"

or

  nix-env -f .../i686-linux.nix -E "x: x.subversion11x"

Here x is the attribute set that i686-linux.nix evaluates to.  So
"x.subversion11x" selects the attribute called "subversion11x" from that
set.

> There is no straightforward solution right now and it is very confusing
> for users and really a lot of effort to get everything right.

Absolutely, there is a lot of room for improvement in nix-env.  And also
the confusion distinction between all-packages-generic.nix,
i686-linux.nix, populate-cache.nix and so on.

-- 
Eelco Dolstra | http://www.cs.uu.nl/~eelco



More information about the nix-dev mailing list