From ac8c823955c31c74f66afd22e07ec4d4936bd638 Mon Sep 17 00:00:00 2001 From: Malte Brandy Date: Tue, 14 Jul 2020 22:20:07 +0200 Subject: [PATCH] ghc.withPackages: Wrap hls with package lookup env --- .../haskell-modules/with-packages-wrapper.nix | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/pkgs/development/haskell-modules/with-packages-wrapper.nix b/pkgs/development/haskell-modules/with-packages-wrapper.nix index 3b8d906cecef..a34af634e147 100644 --- a/pkgs/development/haskell-modules/with-packages-wrapper.nix +++ b/pkgs/development/haskell-modules/with-packages-wrapper.nix @@ -105,14 +105,16 @@ symlinkJoin { --set "NIX_${ghcCommandCaps}_LIBDIR" "${libDir}" fi - # ghcide does package discovery without calling our ghc wrapper. - if [[ -x "$out/bin/ghcide" ]]; then - wrapProgram $out/bin/ghcide \ + # ghcide and haskell-language-server do package discovery without calling our ghc wrapper. + for prg in ghcide haskell-language-server; do + if [[ -x "$out/bin/$prg" ]]; then + wrapProgram $out/bin/$prg \ --set "NIX_${ghcCommandCaps}" "$out/bin/${ghcCommand}" \ --set "NIX_${ghcCommandCaps}PKG" "$out/bin/${ghcCommand}-pkg" \ --set "NIX_${ghcCommandCaps}_DOCDIR" "${docDir}" \ --set "NIX_${ghcCommandCaps}_LIBDIR" "${libDir}" - fi + fi + done '' + (lib.optionalString (stdenv.targetPlatform.isDarwin && !isGhcjs && !stdenv.targetPlatform.isiOS) '' # Work around a linker limit in macOS Sierra (see generic-builder.nix):