Skip to content

Commit a888817

Browse files
guibouwz1000
authored andcommitted
chore: add the nix stuffs for GHC 9.4
I've just added naively the different nix lines. The configuration file comes from a copy of the one for 9.2. With that, we can open a shell with `nix develop .\#haskell-language-server-941-dev` and type `cabal build`. (cherry picked from commit 48084ab)
1 parent 111901f commit a888817

File tree

2 files changed

+48
-0
lines changed

2 files changed

+48
-0
lines changed

configuration-ghc-94.nix

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
{ pkgs, inputs }:
2+
3+
let
4+
disabledPlugins = [
5+
"hls-hlint-plugin"
6+
# That one is not technically a plugin, but by putting it in this list, we
7+
# get it removed from the top level list of requirement and it is not pull
8+
# in the nix shell.
9+
"shake-bench"
10+
];
11+
12+
hpkgsOverride = hself: hsuper:
13+
with pkgs.haskell.lib;
14+
{
15+
hlsDisabledPlugins = disabledPlugins;
16+
# YOLO
17+
mkDerivation = args:
18+
hsuper.mkDerivation (args // {
19+
jailbreak = true;
20+
doCheck = false;
21+
});
22+
} // (builtins.mapAttrs (_: drv: disableLibraryProfiling drv) {
23+
# ptr-poker breaks on MacOS without SSE2 optimizations
24+
# https://github.com/nikita-volkov/ptr-poker/issues/11
25+
ptr-poker = hself.callCabal2nix "ptr-poker" inputs.ptr-poker { };
26+
27+
ghc-exactprint =
28+
hself.callCabal2nix "ghc-exactprint" inputs.ghc-exactprint-150 { };
29+
# Hlint is still broken
30+
hlint = doJailbreak (hself.callCabal2nix "hlint" inputs.hlint { });
31+
32+
stylish-haskell = appendConfigureFlag hsuper.stylish-haskell "-fghc-lib";
33+
34+
# Re-generate HLS drv excluding some plugins
35+
haskell-language-server =
36+
hself.callCabal2nixWithOptions "haskell-language-server" ./.
37+
(pkgs.lib.concatStringsSep " " [ "-fpedantic" "-f-hlint" ]) { };
38+
});
39+
in {
40+
inherit disabledPlugins;
41+
tweakHpkgs = hpkgs: hpkgs.extend hpkgsOverride;
42+
}

flake.nix

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,7 @@
215215

216216
ghc902Config = (import ./configuration-ghc-90.nix) { inherit pkgs inputs; };
217217
ghc924Config = (import ./configuration-ghc-92.nix) { inherit pkgs inputs; };
218+
ghc941Config = (import ./configuration-ghc-94.nix) { inherit pkgs inputs; };
218219

219220
# GHC versions
220221
# While HLS still works fine with 8.10 GHCs, we only support the versions that are cached
@@ -224,11 +225,13 @@
224225
cases = {
225226
ghc902 = ghc902Config.tweakHpkgs (pkgs.hlsHpkgs "ghc902");
226227
ghc924 = ghc924Config.tweakHpkgs (pkgs.hlsHpkgs "ghc924");
228+
ghc941 = ghc941Config.tweakHpkgs (pkgs.hlsHpkgs "ghc941");
227229
};
228230
in { default = cases."${ghcVersion}"; } // cases;
229231

230232
ghc902 = supportedGHCs.ghc902;
231233
ghc924 = supportedGHCs.ghc924;
234+
ghc941 = supportedGHCs.ghc941;
232235
ghcDefault = supportedGHCs.default;
233236

234237
# For markdown support
@@ -361,19 +364,22 @@
361364
haskell-language-server-dev = mkDevShell ghcDefault "cabal.project";
362365
haskell-language-server-902-dev = mkDevShell ghc902 "cabal.project";
363366
haskell-language-server-924-dev = mkDevShell ghc924 "cabal.project";
367+
haskell-language-server-941-dev = mkDevShell ghc941 "cabal.project";
364368
};
365369

366370
# Developement shell, haskell packages are also provided by nix
367371
nixDevShells = {
368372
haskell-language-server-dev-nix = mkDevShellWithNixDeps ghcDefault "cabal.project";
369373
haskell-language-server-902-dev-nix = mkDevShellWithNixDeps ghc902 "cabal.project";
370374
haskell-language-server-924-dev-nix = mkDevShellWithNixDeps ghc924 "cabal.project";
375+
haskell-language-server-941-dev-nix = mkDevShellWithNixDeps ghc941 "cabal.project";
371376
};
372377

373378
allPackages = {
374379
haskell-language-server = mkExe ghcDefault;
375380
haskell-language-server-902 = mkExe ghc902;
376381
haskell-language-server-924 = mkExe ghc924;
382+
haskell-language-server-941 = mkExe ghc941;
377383
};
378384

379385
devShells = simpleDevShells // nixDevShells // {

0 commit comments

Comments
 (0)