Skip to content

Commit 48084ab

Browse files
committed
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`.
1 parent f857231 commit 48084ab

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
@@ -214,6 +214,7 @@
214214

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

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

229231
ghc902 = supportedGHCs.ghc902;
230232
ghc924 = supportedGHCs.ghc924;
233+
ghc941 = supportedGHCs.ghc941;
231234
ghcDefault = supportedGHCs.default;
232235

233236
# For markdown support
@@ -360,19 +363,22 @@
360363
haskell-language-server-dev = mkDevShell ghcDefault "cabal.project";
361364
haskell-language-server-902-dev = mkDevShell ghc902 "cabal.project";
362365
haskell-language-server-924-dev = mkDevShell ghc924 "cabal.project";
366+
haskell-language-server-941-dev = mkDevShell ghc941 "cabal.project";
363367
};
364368

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

372377
allPackages = {
373378
haskell-language-server = mkExe ghcDefault;
374379
haskell-language-server-902 = mkExe ghc902;
375380
haskell-language-server-924 = mkExe ghc924;
381+
haskell-language-server-941 = mkExe ghc941;
376382
};
377383

378384
devShells = simpleDevShells // nixDevShells // {

0 commit comments

Comments
 (0)