I find the options search to be generally suitable for that case https://search.nixos.org/options
However, a bunch of packages are defined in some bespoke way with various custom config inputs that generate other bits of config and generally are hard to understand. Thinking it through, I'm not sure it's possible for the OP's tool to solve this particular problem.