The repa maintainers have released 2.1.1.5, which works with ghc 7.0.4 and earlier. Also, there is version 2.1.1.6, which works with ghc 7.2 and newer. Now, how can we support this setup?
The obvious solution would be:
# Version 2.1.1.5 is intended for ghc <7.2, and version 2.1.1.6 is for the newer GHC.
repa_2_1_1_5 = callPackage ../development/libraries/haskell/repa/2.1.1.5.nix {};
repa_2_1_1_6 = callPackage ../development/libraries/haskell/repa/2.1.1.6.nix {};
repa = self.repa_2_1_1_5;
This is confusing, though, because nix-env -i is always going to pick the latest version. Also, a derivation like repaExamples is not going to work on 7.2.1 either, without further overrides in haskellPlatformDefaults_future.
An alternative is:
repa = if "${ghc.version}" == "7.2.1"
then (callPackage ../development/libraries/haskell/repa/2.1.1.6.nix {})
else (callPackage ../development/libraries/haskell/repa/2.1.1.5.nix {});
That works fine, but it doesn't work for ghcHEAD. We could add more version numbers into that check, of course, but that feels like an approach that won't scale.
We might be able to rescue that previous approach by adding a flag to the GHC expression, say "base_4_4 = true" for >=7.2 and "base_4_4 = false" for the older ones.