Skip to content

Commit c8007c3

Browse files
committed
Add hoogle to shell.nix
1 parent d74d111 commit c8007c3

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

shell.nix

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,21 @@
66

77
{ sources ? import nix/sources.nix,
88
nixpkgs ? import sources.nixpkgs {},
9-
compiler ? "default"
9+
compiler ? "default",
10+
hoogle ? false
1011
}:
1112
with nixpkgs;
1213

1314
let defaultCompiler = "ghc" + lib.replaceStrings ["."] [""] haskellPackages.ghc.version;
1415
haskellPackagesForProject = p:
1516
if compiler == "default" || compiler == defaultCompiler
16-
then haskellPackages.ghcWithPackages p
17-
# for all other compilers there is no Nix cache so dont bother building deps with NIx
18-
else haskell.packages.${compiler}.ghcWithPackages (_: []);
17+
then if hoogle
18+
then haskellPackages.ghcWithHoogle p
19+
else haskellPackages.ghcWithPackages p
20+
# for all other compilers there is no Nix cache so dont bother building deps
21+
else if hoogle
22+
then haskell.packages.${compiler}.ghcWithHoogle (_: [])
23+
else haskell.packages.${compiler}.ghcWithPackages (_: []);
1924

2025
retrie = with haskell.lib; dontCheck(disableLibraryProfiling(haskellPackages.retrie));
2126
compilerWithPackages = haskellPackagesForProject(p:

0 commit comments

Comments
 (0)