[Nix-dev] I'm stuck again.. How is the nix way to do this? nix-env -i superfluous?

Marc Weber marco-oweber at gmx.de
Wed Aug 15 04:51:00 CEST 2007


After having talked to Michael Raskin on #trace today I got some doubts
wether the way I was gaing is the right one..


The issue: (simple dependency graph):

   / >   libA \
ghc - >  libB -> executable or libD ..
  \  >   libC /

instead of executable or libD you usually have another option:

ghc with libA,B,C .. so that you can develop and run your own stuff..

The gcc way to get this is : 
  Put everything into /usr/{lib,include}

The haskell way to accomplish the same:
  use GHC_PACKAGE_PATH and add all libraries (or put them into dir X and
  let the wrapper collect them again ..)

I've added post-installer support to my local nix system which does the
collecting before invoking the wrapper. Thus the wrapper does not have
to glob directories..

The pure nix way to this is a different one:

ghcWrapper = (import ..) {
  providedLibraries = [ lib1 lib2 lib3 lib4 ... lib100 ];
  ghcToWrap = ghcXX;
}

But there are 2^(count libraries) possibilities to create wrappers...
How should the user be using this?
nix-env -i libA
nix-env -i libB
(the draditional way) is not suitable..

The best would be if he creates this ghcWrapper expression itself adding
all the libraries he wants to use..
But how does this fit with garbage collection etc?
a echo $providedLibraries > $out/nix-support/keep would be enough,
wouldn't it?

In the end we only have one expression:

mynix = derivation {
  all_stuff = [ ghc ghcWrapperWithLibs mutt ... ... ... ... .. .. 100
  150 1000 ];
}

and we no longer have a nix-env -i at all?

But instead we have a gui application (similar to apt-get) collecting
all availible nix expressions but mynix automatically creating mynix ?
the nix derivation tree traversal would be easy too: Just take each
attribute set having a meta attribute.. and show this information as
installation description.. Then we no longer need the name attribute..

At least this would make the most sense to me..
But you can forget about binary installs then thingking of the
ghcWrapper ...

Is this all just nonsense or the way to go?

nix is crazy cool!

Marc Weber



More information about the nix-dev mailing list