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

Andres Loeh andres at cs.uu.nl
Wed Aug 15 10:19:25 CEST 2007


Here's an opinion, based on my limited nix world-view:

> 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..

Sure, you can't put all the wrappers in all-packages.nix.

> 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?

Yes, I think that having nix expressions per user is the way to go.
Each user should generate his/her own parameterized nix expressions.
This does not only apply to ghc+libs, btw, but also to stuff like
optional support for X,Y,Z in package A. Then you also already have
8 different variants. Generally, nix supports building lots of variants
of a single package, so it would be a shame to limit the possibilities
of the user by only providing fixed instantiations.

> 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?

I'd see it more as generalizing nix-env -i. At the moment, you can
fully instantiated nix expressions (i.e., non-functions) to your
environment. Ideally, there'd be an UI where you can add functions
still lacking arguments, and get some guided help what to fill in for
the arguments. Phantasy syntax:

nix-env -i ghc --with-libs="gtk2hs quickcheck"
nix-env -i ghostview --with-x11

Correspondingly, nix-env -q could provide output over the available
flags per expression. The program nix-env would then translate all the
commands into a per-user expression, what maybe it already does.

> 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..

I don't quite understand this. Do you mean something similar to what
I outlined above?

Cheers,
  Andres

-- 

Andres Loeh, Universiteit Utrecht

mailto:andres at cs.uu.nl     mailto:mail at andres-loeh.de
http://www.andres-loeh.de



More information about the nix-dev mailing list