[Nix-dev] gentoo like nixpkgs globala useflags in nixpkgs config - would it be worth it?

Marc Weber marco-oweber at gmx.de
Fri Mar 24 16:18:25 CET 2017


Issue pulseSupport -> does it make sense to have a global 'enable pulse
for all packgages' config.pulseSupport = true flag?

packages could be using:  config.pulseSupport or false to disable by
default then.

Gentoo use flags traditionally have been used to enable commonly used
flags such as 'qt support' 'gtk support' or similar.

in the specific pulse case I was told on irc that most packages like
mplayer even work with pulse without having pulse built in.
But same applies to jackd or whatsoever.

The next question is: Which flags might be worth adding right now
(because for instance this would also mean changing flags for sox using
consistent naming which uses enablePulseaudio something flag).

And how / where would those global flags be documented ?

Having a defaultFlags = {
  config.sox = null; # does this cause the package default being used in "config.sox or false" ?
  config.pulseSupport = null; # please note: you can enable, but most packages will work with pulse without doing so 
  config.qtSupport = null;
  config.gtkSupport = null;
}

And then there was a common way to document and set the same behaviour
which affects many packages. Maybe there is already a way which I might
have missed?

Thus package defaults could look like this:


pulseSuport ?
  let flag = 'pulseSupport';
  let package = 'sox';
  in config.$flag or config.$package.$flag or false;
     ^ global       ^ package global          ^ derivation default

So you can set nixpgks config to either

pulseSupport = true -> all packages
mplayer.pulseSupport = true -> mplayer only

or still override with .override ( .. ) the known way.

I'm not going to change anything - just want to understand current
situation and whether its worth thinking about it.

Marc Weber


More information about the nix-dev mailing list