I'm trying to use hoogle in a Haskell development environment exactly like the one described by O'Charles' wiki:
I have modified shell.nix
like below in order to use hoogleLocal
, but it doesn't seem to install the hoogle binary for me.
let
pkgs = import <nixpkgs> {};
# I'm attempting to use hoogle here, but it is not working.
haskellPackages =
let callPackage = pkgs.lib.callPackageWith haskellPackages;
in pkgs.recurseIntoAttrs (pkgs.haskellPackages.override {
extension = self: super: {
thiscurrentpackage = self.callPackage ./. {};
hoogleLocal = pkgs.haskellPackages.hoogleLocal.override {
packages = self.thiscurrentpackage;
};
};
});
in pkgs.myEnvFun {
name = haskellPackages.thiscurrentpackage.name;
buildInputs = [
(haskellPackages.ghcWithPackages (hs: ([
hs.cabalInstall
hs.ghcMod
hs.yesodBin
# This doesn't appear to install the hoogle binary?
hs.hoogleLocal
] ++ hs.thiscurrentpackage.propagatedNativeBuildInputs)))
];
}
In the resulting shell, the hoogle
binary is not available.
If I include hs.hoogle
to the buildInputs
, the hoogle
binary is installed but it can't find the databases. Below is what happens when I try to use it.
$ nix-shell
......
$ hoogle Monad
Could not find some databases: default
Searching in:
.
/nix/store/91y9q2y5a2ws8xgcsx1gkhfagc0f2qz6-haskell-hoogle-ghc7.8.3-4.2.36-shared/share/x86_64-linux-ghc-7.8.3/hoogle-4.2.36/databases
There are no available databases, generate them with: hoogle data
$ hoogle data
hoogle: /nix/store/91y9q2y5a2ws8xgcsx1gkhfagc0f2qz6-haskell-hoogle-ghc7.8.3-4.2.36-shared/share/x86_64-linux-ghc-7.8.3/hoogle-4.2.36/databases:
changeWorkingDirectory: does not exist (No such file or directory)
$
How do I get this working correctly for a setup like described by O'Charles?
Edit: The original shell.nix is the same one from this answer.