[Nix-dev] Re: I'm stuck again.. How is the nix way to do this? nix-env -i superfluous?
apfelmus
apfelmus at quantentunnel.de
Wed Aug 15 12:52:58 CEST 2007
Andres Loeh wrote:
> 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.
>
> Marc Weber wrote:
>> 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 can see nix-env -i as a way to populate all_stuff ..
>> and builder.pl is mynix.. So it is already there?
Yes, nix-env -i is like adding stuff to a user-defined nix-expression,
namely the one that generates the user-environment.
(I think that) currently, the user-environment has no nix-expression,
but is build by some shell/perl-script. This means that nix package
writers have a hard time to customize user environments. It seems that
the ./nix-support/ directory has significance here, is there any
documentation about it, Eelco?
The user environment is still managed by the garbage collector, though.
Remember that nix-expressions and the storage-manager are two different
things. The latter can happily live without the former.
> 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.
Note that you can already install arbitrary nix expressions into your
environment. I guess that the following should work
$ nix-env -i -E 'f: f.ghostview {x11Support = true; x11 = f.x11 }'
See also the manual for nix-env. Of course, the syntax could use less
space but I think that's as best as we can get.
>> But instead we have a gui application (similar to apt-get) collecting
>> all available 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..
That would be a GUI for writing a nix-expression that creates the
user-environment.
Regards,
apfelmus
More information about the nix-dev
mailing list