Add `useLocalGhcLib` project option (#2510)
* Add `useLocalGhcLib` project option
Surface what `modules/configuration-nix.nix` used to do
unconditionally as an opt-in `useLocalGhcLib` flag, so the
`packages.ghc.src` override only fires when a project actually
constrains the `ghc` package (e.g. `ghc-lib-reinstallable`).
Four pieces:
* `modules/project-common.nix`: add the `useLocalGhcLib` option
(default `false`).
* `modules/configuration-nix.nix`: drop the unconditional
`packages.ghc.src` / `packages.ghc.package-description-override`
overrides — they're moved into the per-project wiring below.
* `modules/stack-project.nix`: under `useLocalGhcLib`, re-apply
the `packages.ghc.src` post-plan override. Stack-to-nix can't
use the cabal-project route, so this keeps the existing
behaviour for stack users who flip the flag.
* `modules/cabal-project.nix`: under `useLocalGhcLib`, inject a
`source-repository-package` block into `cabalProjectLocal`
pointing at the configured-src + generated GHC tree, and add an
`inputMap` entry so haskell.nix doesn't try to fetch the URL.
Cabal then hashes the wrapped repo's content into
`pkg-src-sha256` and installs `lib:ghc` like any other
reinstallable dep.
Projects that need the previous always-on behaviour now set
`useLocalGhcLib = true` on the project module; everyone else gets
a smaller plan-nix and avoids the unconditional `configured-src`
materialisation.
Pulled out of #2504 (`hkm/builder-v2`).
* ghc-lib-reinstallable test + changelog: set useLocalGhcLib = true
Flips the new opt-in flag in both test variants and adds a
changelog entry telling users to do the same when they constrain
`lib:ghc`.