[Nix-dev] Re: WIKI question misc.collection, multiple ghc in PATH, "bit of problem",

Peter Simons simons at cryp.to
Tue Aug 23 20:26:59 CEST 2011


Hi Marc,

I have edited the page

  http://wiki.nixos.org/wiki/Howto_keep_multiple_packages_up_to_date_at_once

a bit, so that it mentions nix-env -u. There's more to say about the
subject, of course, but as always time is limited.


 > If you have Vim in your env and if Vim was dropped nix-env -i \* would
 > not tell you. Using a collection still tries evaluating attr vim and
 > fails.

Yes, that is true. Also, packages sometimes change their name, and
you'll never know. I frequently run

  nix-env -i $(nix-env -q \*) --dry-run

to ensure that I notice that kind of thing. Referring to packages by
attribute is nicer in that regard, because it's more robust. Collections
are good for that. The downside is, of course, that collections hide
their contents; "nix-env -q \*" doesn't show all individual packages.


 > That's why I don't consider the -u being an alternative.

I like "nix-env -u \* --always" a lot, and I wouldn't want to do without
it. Anyway, 'buildEnv' seems like a perfectly good way build collections
in a way that doesn't exclude using nix-env -u, so it's possible to use
both mechanisms.


 > Also using collections enforce consistent snapshots: You always update
 > ghc and packages. You never update ghc-haskell-posix-regex only causing
 > ghc and library mismatches.

I'm not sure what you mean. nix-env -u \* never updates a Haskell
library to a version that's built with a different compiler; it only
updates to a later version that has been built with the same compiler.

Unfortunately, the same is not true for ghc-x.y.z-wrapper or ghc-x.y.z,
which may be updated a different version (without updating the other
installed libraries). However, GHC updates are somewhat rare, and they
hardly ever occur without me noticing, so this has been a minor issue
for me.

A major issue is that I cannot run "nix-env -u \*" on a profile that
contains an old version of GHC without nix trying to update it. That is
really annoying.


 > So do you suggest changing the scope of the article to "various ways
 > by example to update packages and their pros and cons"?

Yes, that would be great. Managing several profiles is by no means easy,
and it would be nice if there were a hands-on tutorial for new users
that explains all the different strategies that people have come up with
over the years.

Take care,
Peter




More information about the nix-dev mailing list