Skip to content

Commit 8d4aef0

Browse files
hamishmackpranaysashank
authored andcommitted
Compile hoogle with GHC version from the shell (input-output-hk#2227)
1 parent 02089f0 commit 8d4aef0

File tree

2 files changed

+6
-16
lines changed

2 files changed

+6
-16
lines changed

builder/default.nix

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -64,13 +64,7 @@ let
6464
then pkgs.path
6565
else pkgs.haskell-nix.sources.nixpkgs-2405;
6666
nixpkgsHoogle = import (nixpkgs + /pkgs/development/haskell-modules/hoogle.nix);
67-
in { packages ? [], hoogle ? pkgs.buildPackages.haskell-nix.tool "ghc982" "hoogle" {
68-
inherit evalPackages;
69-
version = "5.0.18.4";
70-
# index-state = pkgs.haskell-nix.internalHackageIndexState;
71-
index-state = "2024-05-14T23:56:58Z";
72-
}
73-
}:
67+
in { packages ? [], hoogle }:
7468
let
7569
haskellPackages = {
7670
# For musl we can use haddock from the buildGHC

builder/shell-for.nix

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -144,21 +144,17 @@ let
144144
pname = p.identifier.name;
145145
haddockDir = p.haddockDir;
146146
};
147-
in hoogleLocal ({
147+
in hoogleLocal {
148148
packages = map docPackage (haskellLib.flatLibDepends component);
149149

150-
# Need to add hoogle to hsPkgs.
151-
# inherit (hsPkgs) hoogle;
152-
} // (
153-
lib.optionalAttrs (args ? tools && args.tools ? hoogle) {
154-
hoogle = buildPackages.haskell-nix.hackage-tool (
155-
haskellLib.versionOrModToMods args.tools.hoogle ++ [{
150+
hoogle = pkgsBuildBuild.haskell-nix.hackage-tool (
151+
lib.optionals (args ? tools && args.tools ? hoogle) (haskellLib.versionOrModToMods args.tools.hoogle)
152+
++ [{
156153
name = "hoogle";
157154
compiler-nix-name = compiler.nix-name;
158155
inherit evalPackages;
159156
}]);
160-
}
161-
));
157+
};
162158

163159
mkDrvArgs = builtins.removeAttrs args ["packages" "components" "additional" "withHoogle" "tools"];
164160
in

0 commit comments

Comments
 (0)