`ghcWithPackages` broke in #411741, partially because we don't have tests for it. This adds some tests to make sure it keeps working in the future. For now these tests will fail until #415436 is fixed. This is split off of #415434. Adds a regression test for https://github.com/NixOS/nixpkgs/pull/224542