hadrian: allow changing haddock flags via `--docs`, flavour transformer or UserSettings.hs
Motivation
In nixpkgs, we are struggling to keep the size of aarch64-linux GHC (with profiling libs) plus its documentation under 3GB which is an arbitrary size limit we impose on https://hydra.nixos.org. In the past, we've dealt with this by disabling profiling since the limit was 2GB which was impossible to keep below any other way. With 3GB, GHC fits including docs for the make build system and GHC < 9.6, but with hadrian and GHC >= 9.6 we are just over the limit. It seems like disabling --hyperlinked-source
for the documentation is the least bad way to save enough space.
Proposal
Allow influencing the haddock flags in hadrian somehow, so that --hyperlinked-source
can be disabled. I'm not sure what the best mechanism for this would be (probably UserSettings?). Maybe making other flags configurable is also interesting—no clue.