From 9549b8a1d168039af3105d8298a3ea9167ac8ba2 Mon Sep 17 00:00:00 2001 From: Hamish Mackenzie Date: Sun, 14 Jul 2024 23:31:29 +1200 Subject: [PATCH] Compile `hoogle` with GHC version from the shell (#2227) --- builder/default.nix | 8 +------- builder/shell-for.nix | 14 +++++--------- 2 files changed, 6 insertions(+), 16 deletions(-) diff --git a/builder/default.nix b/builder/default.nix index e7ff9e7f46..6a029e8964 100644 --- a/builder/default.nix +++ b/builder/default.nix @@ -64,13 +64,7 @@ let then pkgs.path else pkgs.haskell-nix.sources.nixpkgs-2205; nixpkgsHoogle = import (nixpkgs + /pkgs/development/haskell-modules/hoogle.nix); - in { packages ? [], hoogle ? pkgs.buildPackages.haskell-nix.tool "ghc928" "hoogle" { - inherit evalPackages; - version = "5.0.18.3"; - # index-state = pkgs.haskell-nix.internalHackageIndexState; - index-state = "2023-06-05T00:00:00Z"; - } - }: + in { packages ? [], hoogle }: let haskellPackages = { # For musl we can use haddock from the buildGHC diff --git a/builder/shell-for.nix b/builder/shell-for.nix index 69f8399aac..359546dbbd 100644 --- a/builder/shell-for.nix +++ b/builder/shell-for.nix @@ -142,21 +142,17 @@ let pname = p.identifier.name; haddockDir = p.haddockDir; }; - in hoogleLocal ({ + in hoogleLocal { packages = map docPackage (haskellLib.flatLibDepends component); - # Need to add hoogle to hsPkgs. - # inherit (hsPkgs) hoogle; - } // ( - lib.optionalAttrs (args ? tools && args.tools ? hoogle) { - hoogle = pkgsBuildBuild.haskell-nix.hackage-tool ( - haskellLib.versionOrModToMods args.tools.hoogle ++ [{ + hoogle = pkgsBuildBuild.haskell-nix.hackage-tool ( + lib.optionals (args ? tools && args.tools ? hoogle) (haskellLib.versionOrModToMods args.tools.hoogle) + ++ [{ name = "hoogle"; compiler-nix-name = compiler.nix-name; inherit evalPackages; }]); - } - )); + }; mkDrvArgs = builtins.removeAttrs args ["packages" "components" "additional" "withHoogle" "tools"]; in