I made two demo implementations of Gentoo-like use-flags (https://github.com/NixOS/nixpkgs/issues/12877\) for nixpkgs:
- Undesirable one [Demo] splice.nix: poor man's implementation of Gentoo-like use-flags by oxij · Pull Request #56109 · NixOS/nixpkgs · GitHub
- The, IMHO, desirable one https://github.com/NixOS/nixpkgs/pull/56110 that needs some more work (and, hence, consensus on merging that work to nixpkgs in the first place).
https://github.com/NixOS/nixpkgs/pull/56110 also has all the technical details and thoughts on the topic.
Any thoughts are welcome here or there.