Skip to content

Commit 9549b8a

Browse files
authored
Compile hoogle with GHC version from the shell (#2227)
1 parent a6fa8bc commit 9549b8a

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-2205;
6666
nixpkgsHoogle = import (nixpkgs + /pkgs/development/haskell-modules/hoogle.nix);
67-
in { packages ? [], hoogle ? pkgs.buildPackages.haskell-nix.tool "ghc928" "hoogle" {
68-
inherit evalPackages;
69-
version = "5.0.18.3";
70-
# index-state = pkgs.haskell-nix.internalHackageIndexState;
71-
index-state = "2023-06-05T00:00:00Z";
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
@@ -142,21 +142,17 @@ let
142142
pname = p.identifier.name;
143143
haddockDir = p.haddockDir;
144144
};
145-
in hoogleLocal ({
145+
in hoogleLocal {
146146
packages = map docPackage (haskellLib.flatLibDepends component);
147147

148-
# Need to add hoogle to hsPkgs.
149-
# inherit (hsPkgs) hoogle;
150-
} // (
151-
lib.optionalAttrs (args ? tools && args.tools ? hoogle) {
152-
hoogle = pkgsBuildBuild.haskell-nix.hackage-tool (
153-
haskellLib.versionOrModToMods args.tools.hoogle ++ [{
148+
hoogle = pkgsBuildBuild.haskell-nix.hackage-tool (
149+
lib.optionals (args ? tools && args.tools ? hoogle) (haskellLib.versionOrModToMods args.tools.hoogle)
150+
++ [{
154151
name = "hoogle";
155152
compiler-nix-name = compiler.nix-name;
156153
inherit evalPackages;
157154
}]);
158-
}
159-
));
155+
};
160156

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

0 commit comments

Comments
 (0)