Previously, setting environment variables in a Haskell package build
required using `.overrideAttrs`, which (I think?) breaks later
invocations of `haskell.lib.overrideCabal`.
This patch adds an `env` argument to `haskellPackages.mkDerivation`,
which can be used to set environment variables during Haskell package
builds.
`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
Since the rust writer doesn't seem to get fixed on darwin, we'll just
wrap the haskell writer test in our own derivation (which is possible
since tests.writers exposes a bunch of internals via passthru) and
expose it via tests.haskell which are already in mergeable.
Finally a way to test the (hopefully) working haskell writer on darwin
again!