How to debug dependency failure


I want to try fresh GHC which support linear let bindings.
The language feature requires a complex library (linear-base) and it requires to build lot of dependencies. One of them is happy tool.
I created a nix project overriding GHC version from git head and overriding failing dependencies with branched versions.

At current state entering nix-shell ends with

No pkg-config found
Using runghc version 9.8.1 found on system at:
Using strip version 2.41 found on system at:
Using tar found on system at:
No uhc found
Running phase: buildPhase
Preprocessing executable 'happy' for happy-1.21.0..
Error: Setup: The program 'happy' is required but it could not be found

error: builder for '/nix/store/ccphy1szsn9fg2lx80p299bib2ky9izp-happy-1.21.0.drv' failed with exit code 1
error: 1 dependencies of derivation '/nix/store/l73rh8grlx1wqsjshdf344x44c75g2cj-ghc-9.8.1-with-packages.drv' failed to build

I don’t understand what is wrong, because happy build almost finished without error.

Ideally would be to have an option to treat such condition as an “exception” and drop into a bash shell without loosing context - i.e. uncommitted files to nix storage to do investigation. Can nix do such kind of trick?

Any advice how to get more info about such issue is welcome.

project reproducing the error

just for reference