Skip to content

Commit 774e6d7

Browse files
committed
9.6 nix
1 parent f113636 commit 774e6d7

File tree

4 files changed

+176
-21
lines changed

4 files changed

+176
-21
lines changed

.github/workflows/nix.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ jobs:
103103
# We only build nix dev shell for current GHC version because some are
104104
# failing with different GHC version on darwin.
105105
- name: Build development shell with nix dependencies for current GHC version
106-
run: nix develop --print-build-logs .#haskell-language-server-dev-nix --profile dev
106+
run: nix develop --print-build-logs .#all-nix-dev-shells --profile dev
107107
- name: Push development shell
108108
if: ${{ env.HAS_TOKEN == 'true' }}
109109
run: cachix push haskell-language-server dev

configuration-ghc-96.nix

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
{ pkgs, inputs }:
2+
3+
let
4+
disabledPlugins = [
5+
# That one is not technically a plugin, but by putting it in this list, we
6+
# get it removed from the top level list of requirement and it is not pull
7+
# in the nix shell.
8+
"shake-bench"
9+
"hls-retrie-plugin"
10+
"hls-splice-plugin"
11+
"hls-class-plugin"
12+
"hls-rename-plugin"
13+
"hls-gadt-plugin"
14+
"hls-refactor-plugin"
15+
];
16+
17+
hpkgsOverride = hself: hsuper:
18+
with pkgs.haskell.lib;
19+
{
20+
hlsDisabledPlugins = disabledPlugins;
21+
22+
# Override for all derivation
23+
# If they are considered as broken, we just disable jailbreak and hope for the best
24+
mkDerivation = args:
25+
hsuper.mkDerivation (args //
26+
{
27+
jailbreak = true;
28+
broken = false;
29+
doCheck = false;
30+
});
31+
apply-refact = hsuper.apply-refact_0_12_0_0;
32+
tagged = hself.callHackage "tagged" "0.8.7" { };
33+
primitive = hself.callHackage "primitive" "0.8.0.0" { };
34+
unix-compat = hself.callCabal2nix "unix-compat" inputs.haskell-unix-compat { };
35+
MonadRandom = hself.callHackage "MonadRandom" "0.6" { };
36+
hiedb = hself.callCabal2nix "hiedb" inputs.haskell-hiedb { };
37+
hie-bios = hself.callCabal2nix "hie-bios" inputs.haskell-hie-bios { };
38+
ghc-exactprint = hself.callCabal2nix "ghc-exactprint" inputs.haskell-ghc-exactprint { };
39+
40+
# ptr-poker breaks on MacOS without SSE2 optimizations
41+
# https://github.com/nikita-volkov/ptr-poker/issues/11
42+
ptr-poker = hself.callCabal2nix "ptr-poker" inputs.ptr-poker { };
43+
44+
ormolu = hself.ormolu_0_5_3_0;
45+
46+
stylish-haskell = appendConfigureFlag hsuper.stylish-haskell "-fghc-lib";
47+
48+
# Re-generate HLS drv excluding some plugins
49+
haskell-language-server =
50+
hself.callCabal2nixWithOptions "haskell-language-server" ./.
51+
# Pedantic cannot be used due to -Werror=unused-top-binds
52+
# Check must be disabled due to some missing required files
53+
(pkgs.lib.concatStringsSep " " [ "--no-check" "-f-pedantic" "-f-hlint" "-f-refactor" "-f-retrie" "-f-class" "-f-gadt" "-f-splice" "-f-rename" ]) { };
54+
};
55+
in {
56+
inherit disabledPlugins;
57+
tweakHpkgs = hpkgs: hpkgs.extend hpkgsOverride;
58+
}

flake.lock

Lines changed: 80 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flake.nix

Lines changed: 37 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
description = "haskell language server flake";
99

1010
inputs = {
11-
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
11+
nixpkgs.url = "github:NixOS/nixpkgs/haskell-updates";
1212
flake-compat = {
1313
url = "github:edolstra/flake-compat";
1414
flake = false;
@@ -40,6 +40,25 @@
4040
url = "https://hackage.haskell.org/package/stylish-haskell-0.14.4.0/stylish-haskell-0.14.4.0.tar.gz";
4141
flake = false;
4242
};
43+
44+
haskell-unix-compat = {
45+
url = "github:jacobstanley/unix-compat/3f6bd688cb56224955e77245a2649ba99ea32fff";
46+
flake = false;
47+
};
48+
haskell-hiedb = {
49+
url = "github:wz1000/HieDb";
50+
flake = false;
51+
};
52+
53+
haskell-hie-bios = {
54+
url = "github:mpickering/hie-bios";
55+
flake = false;
56+
};
57+
58+
haskell-ghc-exactprint = {
59+
url = "github:alanz/ghc-exactprint/ghc-9.6";
60+
flake = false;
61+
};
4362
};
4463
outputs =
4564
inputs@{ self, nixpkgs, flake-compat, flake-utils, gitignore, ... }:
@@ -172,8 +191,9 @@
172191
};
173192

174193
ghc902Config = (import ./configuration-ghc-90.nix) { inherit pkgs inputs; };
175-
ghc927Config = (import ./configuration-ghc-92.nix) { inherit pkgs inputs; };
194+
ghc926Config = (import ./configuration-ghc-92.nix) { inherit pkgs inputs; };
176195
ghc944Config = (import ./configuration-ghc-94.nix) { inherit pkgs inputs; };
196+
ghc961Config = (import ./configuration-ghc-96.nix) { inherit pkgs inputs; };
177197

178198
# GHC versions
179199
# While HLS still works fine with 8.10 GHCs, we only support the versions that are cached
@@ -182,14 +202,16 @@
182202
ghcVersion = "ghc" + (pkgs.lib.replaceStrings ["."] [""] pkgs.haskellPackages.ghc.version);
183203
cases = {
184204
ghc902 = ghc902Config.tweakHpkgs (pkgs.hlsHpkgs "ghc902");
185-
ghc927 = ghc927Config.tweakHpkgs (pkgs.hlsHpkgs "ghc927");
205+
ghc926 = ghc926Config.tweakHpkgs (pkgs.hlsHpkgs "ghc926");
186206
ghc944 = ghc944Config.tweakHpkgs (pkgs.hlsHpkgs "ghc944");
207+
ghc961 = ghc961Config.tweakHpkgs (pkgs.hlsHpkgs "ghc961");
187208
};
188209
in { default = cases."${ghcVersion}"; } // cases;
189210

190211
ghc902 = supportedGHCs.ghc902;
191-
ghc927 = supportedGHCs.ghc927;
212+
ghc926 = supportedGHCs.ghc926;
192213
ghc944 = supportedGHCs.ghc944;
214+
ghc961 = supportedGHCs.ghc961;
193215
ghcDefault = supportedGHCs.default;
194216

195217
pythonWithPackages = pkgs.python3.withPackages (ps: [ps.sphinx ps.myst-parser ps.sphinx_rtd_theme ps.pip]);
@@ -310,32 +332,36 @@
310332
simpleDevShells = {
311333
haskell-language-server-dev = mkDevShell ghcDefault "cabal.project";
312334
haskell-language-server-902-dev = mkDevShell ghc902 "cabal.project";
313-
haskell-language-server-927-dev = mkDevShell ghc927 "cabal.project";
335+
haskell-language-server-926-dev = mkDevShell ghc926 "cabal.project";
314336
haskell-language-server-944-dev = mkDevShell ghc944 "cabal.project";
337+
haskell-language-server-961-dev = mkDevShell ghc961 "cabal.project";
315338
};
316339

317340
# Developement shell, haskell packages are also provided by nix
318341
nixDevShells = {
319342
haskell-language-server-dev-nix = mkDevShellWithNixDeps ghcDefault "cabal.project";
320343
haskell-language-server-902-dev-nix = mkDevShellWithNixDeps ghc902 "cabal.project";
321-
haskell-language-server-927-dev-nix = mkDevShellWithNixDeps ghc927 "cabal.project";
344+
haskell-language-server-926-dev-nix = mkDevShellWithNixDeps ghc926 "cabal.project";
322345
haskell-language-server-944-dev-nix = mkDevShellWithNixDeps ghc944 "cabal.project";
346+
haskell-language-server-961-dev-nix = mkDevShellWithNixDeps ghc961 "cabal.project";
323347
};
324348

325349
# The default shell provided by Nixpkgs for a Haskell package (i.e. the
326350
# one that comes in the `.env` attribute)
327351
envShells = {
328352
haskell-language-server-dev-env = mkEnvShell ghcDefault;
329353
haskell-language-server-902-dev-env = mkEnvShell ghc902;
330-
haskell-language-server-927-dev-env = mkEnvShell ghc927;
354+
haskell-language-server-926-dev-env = mkEnvShell ghc926;
331355
haskell-language-server-944-dev-env = mkEnvShell ghc944;
356+
haskell-language-server-961-dev-env = mkEnvShell ghc961;
332357
};
333358

334359
allPackages = {
335360
haskell-language-server = mkExe ghcDefault;
336361
haskell-language-server-902 = mkExe ghc902;
337-
haskell-language-server-927 = mkExe ghc927;
362+
haskell-language-server-926 = mkExe ghc926;
338363
haskell-language-server-944 = mkExe ghc944;
364+
haskell-language-server-961 = mkExe ghc961;
339365
};
340366

341367
devShells = simpleDevShells // nixDevShells // envShells // {
@@ -354,8 +380,9 @@
354380
all-haskell-language-server = linkFarmFromDrvs "all-haskell-language-server" (lib.unique (builtins.attrValues allPackages));
355381

356382
# Same for all shells
357-
all-nix-dev-shells = linkFarmFromDrvs "all-dev-shells"
358-
(builtins.map (shell: shell.inputDerivation) (lib.unique (builtins.attrValues nixDevShells)));
383+
# We try to build as much as possible, but not much shells are
384+
# working (especially on darwing), so this list is limited.
385+
all-nix-dev-shells = linkFarmFromDrvs "all-dev-shells" (builtins.map (shell: shell.inputDerivation) (lib.unique [nixDevShells.haskell-language-server-dev-nix]));
359386

360387
all-simple-dev-shells = linkFarmFromDrvs "all-simple-dev-shells"
361388
(builtins.map (shell: shell.inputDerivation) (lib.unique (builtins.attrValues simpleDevShells)));

0 commit comments

Comments
 (0)