[Nix-dev] solution for do the right thing (even if you end up having the same package twice)

Nicolas Pierron nicolas.b.pierron at gmail.com
Sat Mar 14 18:16:36 CET 2009


On Sat, Mar 14, 2009 at 16:37, Marc Weber <marco-oweber at gmx.de> wrote:
>> to see wether there is any exception?
>> You don't have to realise it. Wating till the .drv appears is enough.
>
> But I think its time to discuss a solution that satisfies everyone.

finally.

> I can think of
>
> git = mkDerivation { ...
>  buildInputs = optional subversionSupport (subversion.merge enablePerl);
>  ..
> }
>
>  where enablePerl is using something like
>  overridableDelayableArgs so that you can implement enablePerl in
>  this way:
> enablePerl = x :
>  if x.perlSupport then x
>  else trace "warning: enabling perl support in subversion for you automatically !"
>             x // { perlSupport = true; };

1/ I hate the Support suffix, why do we have to add the same suffix to
each option.  This make us write too much things for nothing more.
Something like:

provide = {
  bindings = {
    perl = true;
    python = true;
  };
};

would be nice compare to those flags xxxSupport.

2/ Your method sounds complex to me.  The ideal goal should be that
nixpkgs will be filled by software developpers.  Thus derivation files
should be kept simple to allow understandable copy & paste.  Things
like overridableDelayableArgs are side-effect notation which may
mislead end-users.  The old notation with mkDerivation is simple and
you should not go further than this notation to introduce new
concepts.

NixOS options are simple to understand (as long as you don't want to
know how they are evaluated).

What we should do is to write some kind of options for packages
instead of using these perlSupport attribute.  Later we could add more
sugar to handle your function which extend the derivation.

By the way, I would love to be able to enable perlBindings
(documentations) for all packages by only setting a top-level
attribute.

-- 
Nicolas Pierron
http://www.linkedin.com/in/nicolasbpierron
- If you are doing something twice then you should try to do it once.



More information about the nix-dev mailing list