(Where) are optional deps in `nixpkgs` standardised? (As a prominent reference for pkgs authors)

When fixing missing wayland support in vimiv-qt I realised that the dependency on qtwayland (that trivially fixes this) should be optional. So when skimming other packages I found (at least)

  • qtwayland ? ...
  • enableWayland ? ...
  • withWayland ? ...

in package arguments.

Is there an authorative doc on such “USE flags”, and if not, shouldn’t we have this very prominently to make sure users don’t get unnecessary bloat in their realised nix packages?

I see that some top-level “USE-flags” efforts didn’t make it (e.g. this, this, this, …). As I understand the reason for not wanting this is to avoid (too) many permutations of realised nixpkgs which would harm the binary cache, which I appreciate. Though arguably standardisation is still quite important, and mixing major features wouldn’t really make sense, which warrants top-level definition. Maybe it could work if the concept were applied only to major architectural features, such as headless, wayland? Things like pulseaudio wouldn’t need to be differentiated separately (as in the linked examples), because it’s arguably acceptabe to “force” some “common sound support” bloat for all profiles that are ! headless.

4 Likes