Say I have
services.foo.enable = true; and
environment.systemPackages contains "foo". The latter is often redundant, because the foo service requires the "foo" package. How do I detect such duplicates, where enabling a program or service makes a package entry unnecessary?
In trivial cases a text match would give a pretty good indication of a duplicate, but enabling for example
service.xserver.desktopManager.xfce installs a bunch of packages, any one of which I might have listed in
environment.systemPackages. Is it possible to detect such duplicates as well?
The main goal is simplifying the configuration. The extreme case would be where I add every single package I need to the package list before enabling them, making for a much bigger configuration than necessary.
A secondary goal is simplifying debugging. I've enabled a program or service, but the system does not do what I expect (for example, a tool related to the program or service is not available on the
$PATH). Now, if I had some way of telling that enabling X resulted in package Y being installed, that's one debugging avenue I can exclude immediately.