-
Notifications
You must be signed in to change notification settings - Fork 37
/
shell.nix
36 lines (33 loc) · 1.07 KB
/
shell.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
{ system ? builtins.currentSystem, sources ? import ./nix/sources.nix, ghcVersion ? "96", installHls ? true }:
let
selectHls = self: super: {
haskell-language-server = super.haskell-language-server.override { supportedGhcVersions = [ "${ghcVersion}" ]; };
};
pkgs = import sources.nixpkgs { inherit system; overlays = [ selectHls ]; };
cabal-docspec = import ./nix/cabal-docspec.nix { inherit pkgs; };
stack-wrapped = pkgs.symlinkJoin {
name = "stack";
paths = [ pkgs.stack ];
buildInputs = [ pkgs.makeWrapper ];
postBuild = ''
wrapProgram $out/bin/stack \
--add-flags "\
--nix \
--nix-path=\\"nixpkgs=${pkgs.path}\\"
--nix-shell-file nix/shell-stack.nix \
"
'';
};
in with pkgs;
mkShell {
# Set UTF-8 local so that run-tests can parse GHC's unicode output.
LANG="C.UTF-8";
NIX_PATH = "nixpkgs=${pkgs.path}";
buildInputs = [
haskell.compiler."ghc${ghcVersion}"
cabal-install
stack-wrapped
nix
cabal-docspec
] ++ (if installHls then [ haskell-language-server ] else []);
}