summary refs log tree commit diff
path: root/pkgs/development/haskell-modules/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/development/haskell-modules/default.nix')
-rw-r--r--pkgs/development/haskell-modules/default.nix25
1 files changed, 17 insertions, 8 deletions
diff --git a/pkgs/development/haskell-modules/default.nix b/pkgs/development/haskell-modules/default.nix
index 04158ae8e9b5..7e6f1c0552d5 100644
--- a/pkgs/development/haskell-modules/default.nix
+++ b/pkgs/development/haskell-modules/default.nix
@@ -3,8 +3,6 @@
 , overrides ? (self: super: {})
 }:
 
-with ./lib.nix;
-
 let
 
   fix = f: let x = f x // { __unfix__ = f; }; in x;
@@ -49,18 +47,29 @@ let
       defaultScope = mkScope self;
       callPackage = drv: args: callPackageWithScope defaultScope drv args;
 
+      withPackages = packages: callPackage ./with-packages-wrapper.nix {
+        inherit (self) llvmPackages;
+        haskellPackages = self;
+        inherit packages;
+      };
+
     in
       import ./hackage-packages.nix { inherit pkgs stdenv callPackage; } self // {
 
         inherit mkDerivation callPackage;
 
-        ghcWithPackages = pkgs: callPackage ./with-packages-wrapper.nix {
-          inherit (self) llvmPackages;
-          haskellPackages = self;
-          packages = pkgs self;
-        };
+        ghcWithPackages = selectFrom: withPackages (selectFrom self);
+
+        ghcWithHoogle = selectFrom:
+          let
+            packages = selectFrom self;
+            hoogle = callPackage ./hoogle.nix { inherit packages; };
+          in withPackages (packages ++ [ hoogle ]);
 
-        ghc = ghc // { withPackages = self.ghcWithPackages; };
+        ghc = ghc // {
+          withPackages = self.ghcWithPackages;
+          withHoogle = self.ghcWithHoogle;
+        };
 
       };