The OCaml compiler itself achieves something of this sort by having a number of optional empty option packages whose presence (or the lack of it) affects the compiler itself: opam - ocaml-variants.4.14.0+options.
There’s a longer description of that here: Experimental new layout for the ocaml-variants packages in opam-repository.
Although I’m not sure how recommended this approach is for other packages, especially for 30 parameters. Also, this doesn’t work well if one parameter has many values (the compiler ones are essentially boolean).
Boiling it down to a handful of common configurations might still be reasonable. If someone wishes to fine-tune things more precisely, they might be better off checking out the source repository directly.