forked from haskell/haskell-language-server
-
Notifications
You must be signed in to change notification settings - Fork 0
/
shell.nix
129 lines (122 loc) · 3.28 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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
# This shell.nix file is designed for use with cabal build
# It aims to leverage the nix cache in as much as possible
# while reducing Nix maintenance costs.
# It does **not** aim to replace Cabal/Stack with Nix
# Maintaining this file:
#
# - Dealing with broken nix-shell
#
# 1. Bump the nixpkgs version using `niv update nixpkgs`
# 2. Comment out any remaining failing packages
#
# - Dealing with broken cabal build inside nix-shell:
#
# If my understanding of cabal new-build is correct this should never happen,
# assuming that cabal new-build does succeed outside nix-shell
{ sources ? import nix/sources.nix,
nixpkgs ? import sources.nixpkgs { },
compiler ? "default",
hoogle ? false
}:
with nixpkgs;
let defaultCompiler = "ghc" + lib.replaceStrings ["."] [""] haskellPackages.ghc.version;
haskellPackagesForProject = p:
if compiler == "default" || compiler == defaultCompiler
then if hoogle
then haskellPackages.ghcWithHoogle p
else haskellPackages.ghcWithPackages p
# for all other compilers there is no Nix cache so dont bother building deps
else if hoogle
then haskell.packages.${compiler}.ghcWithHoogle (_: [])
else haskell.packages.${compiler}.ghcWithPackages (_: []);
retrie = with haskell.lib; dontCheck(disableLibraryProfiling(haskellPackages.retrie));
compilerWithPackages = haskellPackagesForProject(p:
with p;
[
Diff
Glob
HsYAML-aeson
QuickCheck
aeson
alex
async
base16-bytestring
blaze-builder
blaze-markup
brittany
conduit-extra
conduit-parse
cryptohash-sha1
data-default
data-default-class
data-default-instances-containers
data-default-instances-dlist
data-default-instances-old-locale
extra
floskell
# fourmolu
fuzzy
generic-deriving
ghc-check
gitrev
haddock-library
happy
haskell-lsp
haskell-src-exts
hie-bios
hslogger
hspec
lens
lsp-test
megaparsec
network
opentelemetry
optparse-simple
ormolu
parser-combinators
parsers
prettyprinter
prettyprinter-ansi-terminal
primes
psqueues
regex-tdfa
retrie
rope-utf16-splay
safe-exceptions
shake
sorted-list
strict
stylish-haskell
tasty
tasty-ant-xml
tasty-expected-failure
tasty-golden
tasty-hunit
tasty-rerun
temporary
text
typed-process
unix-compat
unordered-containers
xml
yaml
zlib
]);
in
stdenv.mkDerivation {
name = "haskell-language-server";
buildInputs = [
git
gmp
ncurses
zlib
haskellPackages.cabal-install
haskellPackages.hlint
compilerWithPackages
];
src = null;
shellHook = ''
export LD_LIBRARY_PATH=${gmp}/lib:${zlib}/lib:${ncurses}/lib
export PATH=$PATH:$HOME/.local/bin
'';
}