haskell-packages: bring hoogle to the masses by imlementing ghcWithHoogle

Replace `ghcWithPackages` to `ghcWithHoogle` in your config and enjoy.
This commit is contained in:
Jan Malakhovski 2015-08-17 19:45:13 +00:00
parent 0ccf8eae2f
commit d8487667cf
2 changed files with 21 additions and 6 deletions

View File

@ -47,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);
ghc = ghc // { withPackages = self.ghcWithPackages; };
ghcWithHoogle = selectFrom:
let
packages = selectFrom self;
hoogle = callPackage ./hoogle.nix { inherit packages; };
in withPackages (packages ++ [ hoogle ]);
ghc = ghc // {
withPackages = self.ghcWithPackages;
withHoogle = self.ghcWithHoogle;
};
};

View File

@ -98,6 +98,10 @@ stdenv.mkDerivation {
chmod +x $out/bin/hoogle
'';
passthru = {
isHaskellLibrary = false; # for the filter in ./with-packages-wrapper.nix
};
meta = {
description = "A local Hoogle database";
platforms = ghc.meta.platforms;