From 38e2e8702c2548c60b8961951552e35ee812c426 Mon Sep 17 00:00:00 2001
From: Peter Simons <simons@cryp.to>
Date: Fri, 9 Jan 2015 19:27:47 +0100
Subject: [PATCH] ghcWithPackages: call this derivation exactly like the
 compiler it's based on

Furthermore, export "name" and "version" attributes that match those of the
underlying compiler. These changes make a ghcWithPackages-generated wrapper
look exactly like a normal GHC derivation and it can be used anywhere in
Nixpkgs where a normal GHC would be used.
---
 pkgs/development/haskell-modules/with-packages-wrapper.nix | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/pkgs/development/haskell-modules/with-packages-wrapper.nix b/pkgs/development/haskell-modules/with-packages-wrapper.nix
index 071f868875f..ad88703edd5 100644
--- a/pkgs/development/haskell-modules/with-packages-wrapper.nix
+++ b/pkgs/development/haskell-modules/with-packages-wrapper.nix
@@ -33,8 +33,8 @@ let
   isHaskellPkg  = x: (x ? pname) && (x ? version);
 in
 if packages == [] then ghc else
-buildEnv {
-  name = "haskell-env-${ghc.name}";
+stdenv.lib.addPassthru (buildEnv {
+  inherit (ghc) name;
   paths = stdenv.lib.filter isHaskellPkg (stdenv.lib.closePropagation packages) ++ [ghc];
   inherit ignoreCollisions;
   postBuild = ''
@@ -76,4 +76,4 @@ buildEnv {
     $out/bin/ghc-pkg recache
     $out/bin/ghc-pkg check
   '';
-}
+}) { inherit (ghc) version; }