From 3dabe1e41af2d8f5b3dace54f8615e8833e14f7b Mon Sep 17 00:00:00 2001 From: Guillaume Bouchard Date: Fri, 13 May 2022 10:41:19 +0200 Subject: [PATCH] wip: restore support for nix for GHC 921 Support was broken by https://github.com/haskell/haskell-language-server/pull/2866 where the configuration-ghc-921 file was removed. https://github.com/haskell/haskell-language-server/pull/2892 will indeed restore these file and fix the build with GHC 922, but I was in need a GHC 921 support at work. --- configuration-ghc-921.nix | 55 +++++++++++++++++++++++++++++++++++++++ flake.lock | 6 ++--- 2 files changed, 58 insertions(+), 3 deletions(-) create mode 100644 configuration-ghc-921.nix diff --git a/configuration-ghc-921.nix b/configuration-ghc-921.nix new file mode 100644 index 0000000000..e4bb72562d --- /dev/null +++ b/configuration-ghc-921.nix @@ -0,0 +1,55 @@ +# nix version of cabal-ghc901.project +{ pkgs, inputs }: + +let + disabledPlugins = [ + "hls-brittany-plugin" + "hls-hlint-plugin" + "hls-haddock-comments-plugin" + "hls-tactics-plugin" + "hls-stylish-haskell-plugin" + "hls-class-plugin" + # That one is not technically a plugin, but by putting it in this list, we + # get it removed from the top level list of requirement and it is not pull + # in the nix shell. + "shake-bench" + ]; + + hpkgsOverride = hself: hsuper: + with pkgs.haskell.lib; + { + hlsDisabledPlugins = disabledPlugins; + + fourmolu = hself.callCabal2nix "fourmolu" inputs.fourmolu {}; + primitive-extras = hself.primitive-extras_0_10_1_2; + ghc-exactprint = hself.callCabal2nix "ghc-exactprint" inputs.ghc-exactprint {}; + constraints-extras = hself.callCabal2nix "constraints-extras" inputs.constraints-extras {}; + retrie = hself.callCabal2nix "retrie" inputs.retrie {}; + + # Hlint is still broken + hlint = doJailbreak (hself.callCabal2nix "hlint" inputs.hlint {}); + hiedb = hself.hiedb_0_4_1_0; + + # Re-generate HLS drv excluding some plugins + haskell-language-server = + hself.callCabal2nixWithOptions "haskell-language-server" ./. + (pkgs.lib.concatStringsSep " " [ + "-f-brittany" + "-f-hlint" + "-f-haddockComments" + "-f-tactics" + "-f-stylishHaskell" + "-f-class" + ]) { }; + + # YOLO + mkDerivation = args: + hsuper.mkDerivation (args // { + jailbreak = true; + doCheck = false; + }); + }; +in { + inherit disabledPlugins; + tweakHpkgs = hpkgs: hpkgs.extend hpkgsOverride; +} diff --git a/flake.lock b/flake.lock index b1d15496c1..cbfb4a51f1 100644 --- a/flake.lock +++ b/flake.lock @@ -101,13 +101,13 @@ "hie-bios": { "flake": false, "locked": { - "narHash": "sha256-nd+FfUQVZNxJfKZkAWA3dF0JwRgXntL+1gGvyNHDbKc=", + "narHash": "sha256-5RqspT27rb/tMBwrKr4VfSSbq0+c0LMNuaKlTun0Kkk=", "type": "tarball", - "url": "https://hackage.haskell.org/package/hie-bios-0.9.0/hie-bios-0.9.0.tar.gz" + "url": "https://hackage.haskell.org/package/hie-bios-0.9.1/hie-bios-0.9.1.tar.gz" }, "original": { "type": "tarball", - "url": "https://hackage.haskell.org/package/hie-bios-0.9.0/hie-bios-0.9.0.tar.gz" + "url": "https://hackage.haskell.org/package/hie-bios-0.9.1/hie-bios-0.9.1.tar.gz" } }, "hlint": {