From 13f22aec257e3650efb7eabadf9c5ddf16e14e18 Mon Sep 17 00:00:00 2001 From: Malte Brandy Date: Wed, 23 Sep 2020 00:43:31 +0200 Subject: [PATCH] haskellPackages.haskell-language-server: Add aliases with ghc version Needed by haskell-language-server-wrapper to discover the correct binary. Especially useful when installing hls from multiple ghc version. --- pkgs/development/haskell-modules/configuration-nix.nix | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/pkgs/development/haskell-modules/configuration-nix.nix b/pkgs/development/haskell-modules/configuration-nix.nix index a1938de0ab37..9be625683732 100644 --- a/pkgs/development/haskell-modules/configuration-nix.nix +++ b/pkgs/development/haskell-modules/configuration-nix.nix @@ -782,4 +782,14 @@ self: super: builtins.intersectAttrs super { testToolDepends = [ pkgs.git pkgs.mercurial ]; }); + haskell-language-server = overrideCabal super.haskell-language-server (drv: { + postInstall = let + inherit (pkgs.lib) concatStringsSep take splitString; + ghc_version = self.ghc.version; + ghc_major_version = concatStringsSep "." (take 2 (splitString "." ghc_version)); + in '' + ln -s $out/bin/haskell-language-server $out/bin/haskell-language-server-${ghc_version} + ln -s $out/bin/haskell-language-server $out/bin/haskell-language-server-${ghc_major_version} + ''; + }); }