Hello fellow Nix users!
I’m starting this conversation to better understand the state of nixpkgs and the way the community as a whole approaches the project.
Just to be clear - I love what Nix ecosystem has to offer and I do really want to stay here in the long term. Yes, maybe Nix language didn’t need to exist and we could have gotten away with an existing (slimmed down) language. Yes, flakes vs no flakes is the endless debate. But I can deal with all of this and be quite successful and productive.
What I am concerned (for the lack of a better word) about is the state of the nixpkgs repository. The package selection is great, but everything is always built differently, following different standards and expectations. For example, you can’t apply a custom patch to Chromium right now. Further to that, quite often there isn’t a way to build a package with exact flags and configuration I would like, simply because these flags aren’t exposed through Nix derivations.
To put things into perspective here, I am coming from Gentoo Linux, where I spent over a decade. What’s worth knowing about Gentoo is that it is a source-based distribution and the maintainers and community are obsessed with providing as much flexibility and control over the dependencies and build options as practically possible. This means that if there is a flag that can be enabled or disabled, Gentoo ebuild would most likely expose it and allow users to toggle it. But they don’t stop there. Quite often, packages have “automagic” dependencies, meaning the dependency will be pulled in if it is presently installed on the system, and will not be pulled in if it is not. This obviously is bad for reproducibility. So when encountered, Gentoo folks would try and work with the package maintainers to expose a proper configuration flag. If that doesn’t work for any reason, they would go and create a patch that will add necessary flags and turn things off as required and will keep maintaining it themselves. If all else fails, as a last resort, they will just give up and mark the package as a hard dependency. This is quite a challenge for the Gentoo ecosystem, however…
…this problem does not exist in Nix. We have full control over what dependencies are exposed to the package at the build time and during runtime, so we can neatly control any hard, soft or automagical dependencies and achieve a much greater degree of control. Awesome, right? Well, not really, because currently nixpkgs is severely lacking in this aspect.
A few recent examples I ran into (in addition to not being able to patch Chromium as I mentioned before):
- Nautilus (Gnome File Browser) has an automagic dependency on
gnome-user-share. This pulls in the Apache HTTP server and stuff. For security reasons, I’d prefer not to have randomly sprinkled HTTP server on my machine, thank you very much; - pipewire exposes a
gstreamerSupportflag, which is great, but is currently broken; - Also pipewire breaks with
bluezSupport=falseflag;
I find this to be a massive letdown - having such a powerful tool and severely underusing it, missing such a big opportunity. Am I the only one thinking this? How do people generally approach problems like this in Nix? I wouldn’t want to fork every single package I use and expose more flags, is that what everyone else is doing?
Any input is appreciated.
Thanks in advance,
Garry ![]()