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

Michael Weiss dev.primeos at gmail.com
Wed Mar 29 02:43:22 CEST 2017


On Fri, 24 Mar, 2017 at 15:18:25 +0000, Marc Weber wrote:
> Gentoo use flags traditionally have been used to enable commonly used
> flags such as 'qt support' 'gtk support' or similar.

I like the idea, especially because it would help creating and using a
consistent naming scheme :)

Btw do we actually already have an official naming scheme for
"use-flags"?

I think most commonly the following naming schemes will be used:
- <package|feature>Support (e.g. mouseSupport, pulseSupport, x11Support)
- enable<Package|"Server"|...> (e.g. enableLDAP, enableGTK3)
- with<Feature> (e.g. withFonts, withJava)
- use<Package|Feature> (e.g. useUnfreeCodecs, useX11, useAlsa, useMupdf)

So at least it seems like we already have an unofficial naming scheme :)

But of course we have some "random" and/or package specific stuff as
well, e.g.:
runtimeCpuDetectBuild, debugDeveloper, optimizationsDeveloper,
extraWarningsDeveloper

Additionally this would probably be very helpful for newcomers, e.g. for the
following use-case:

In order to watch encrypted Blu-rays with vlc one would need to build
libbluray with "withAACS = true" and "withBDplus = true". It would
hopefully be way easier if they could put something like:

defaultFlags = {
  config.encryptedBDSupport = true;
}

or

defaultFlags = {
  config.withAACS = true;
  config.withBDplus = true;
}

Into their config (e.g. /etc/nixos/configuration.nix).

And a nice side-effect would be that documenting such things should be
easier as well (compared to the override method).

> So you can set nixpgks config to either
> 
> pulseSupport = true -> all packages
> mplayer.pulseSupport = true -> mplayer only

I like that idea as well.

On Sat, 25 Mar, 2017 at 23:47:20 +0100, Ertugrul Söylemez wrote:
> It's not *state*, is it?  We're basically already doing global
> configuration, and I think the proposal is about actually using this to
> get a USE-like system.

I would also see it that way. And isn't some stuff already somewhat
similar? E.g.:
- hardware.opengl.driSupport
- hardware.bluetooth.enablea
- services.httpd.enablePHP
- services.printing.enable

But also different because the effects would be global (e.g. no package
would be build with X11 support, etc.).

> IMO it wouldn't hurt, as long as the defaults are sensible, because
> Hydra will most likely only build those (the number of possible
> configurations it could build increases exponentially with every new
> setting, so it couldn't possibly build all of them).

Yeah, I think they would be mostly relevant for reducing binary sizes by
disabling optional stuff or enabling uncommon stuff and that we should
continue building "full-blown binaries".

> In other words: please don't turn NixOS into Gentoo by forcing us to
> compile everything. =)

Especially mass rebuilds would be fun - Gentoo users would probably
laugh at us :D

Regards,
Michael
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 898 bytes
Desc: Digital signature
URL: <http://lists.science.uu.nl/pipermail/nix-dev/attachments/20170329/9546b2ff/attachment.sig>


More information about the nix-dev mailing list