diff --git a/default.nix b/default.nix index 22494c6321e..a121b72e7f9 100644 --- a/default.nix +++ b/default.nix @@ -93,11 +93,10 @@ let ruby sqlite-interactive yq - ]); + ]) ++ attrValues hls; tools = { cabal = "3.2.0.0"; ghcid = "0.8.7"; - ghcide = "0.4.0"; hlint = "3.2"; lentil = "1.3.2.0"; stylish-haskell = "0.11.0.3"; @@ -118,6 +117,11 @@ let ''; }; + # Build latest release of haskell-language-server from github + hls = pkgs.callPackages ./nix/hls.nix { + compiler-nix-name = haskellPackages._config.compiler.nix-name; + }; + self = { inherit pkgs commonLib src haskellPackages profiledHaskellPackages coveredHaskellPackages; # Jormungandr diff --git a/nix/hls.nix b/nix/hls.nix new file mode 100644 index 00000000000..12910f257a7 --- /dev/null +++ b/nix/hls.nix @@ -0,0 +1,32 @@ +{ haskell-nix, fetchFromGitHub, compiler-nix-name }: + +let + hlsPkgs = haskell-nix.cabalProject { + src = fetchFromGitHub { + name = "haskell-language-server"; + owner = "haskell"; + repo = "haskell-language-server"; + rev = "0.5.0"; + sha256 = "0vkh5ff6l5wr4450xmbki3cfhlwf041fjaalnwmj7zskd72s9p7p"; + fetchSubmodules = true; + }; + + # Fix source info of brittany dep + lookupSha256 = { location, tag, ... } : { + "https://github.com/bubba/brittany.git"."c59655f10d5ad295c2481537fc8abf0a297d9d1c" = "1rkk09f8750qykrmkqfqbh44dbx1p8aq1caznxxlw8zqfvx39cxl"; + }."${location}"."${tag}"; + + # Use same GHC as the project + inherit compiler-nix-name; + + # # Materialization voodoo (disabled for now). + # inherit index-state checkMaterialization; + # Invalidate and update if you change the version + # plan-sha256 = "144p19wpydc6c56f0zw5b7c17151n0cghimr9wd8rlhifymmky2h"; + }; + +in + { + inherit (hlsPkgs.haskell-language-server.components.exes) haskell-language-server; + inherit (hlsPkgs.hie-bios.components.exes) hie-bios; + }