1
1
# This shell.nix file is designed for use with cabal build
2
2
# It aims to leverage the nix cache in as much as possible
3
- # It does not aim to replace Cabal/Stack with Nix
3
+ # while reducing Nix maintenance costs.
4
+ # It does **not** aim to replace Cabal/Stack with Nix
4
5
5
- # Before making changes, ensure that the Nix expression works
6
- # for all the GHC versions supported by the project (8.6.x - 8.10.x)
7
6
8
7
{ sources ? import nix/sources.nix ,
9
8
nixpkgs ? import sources . nixpkgs { } ,
10
9
compiler ? "default"
11
10
} :
12
11
with nixpkgs ;
13
12
14
- let haskellPackagesForProject = if compiler == "default"
15
- then haskellPackages . ghcWithPackages
16
- else haskell . packages . ${ compiler } . ghcWithPackages ;
17
-
18
- extraPackages = p : with p ;
19
- if compiler == "ghc8101" then
20
- [ conduit-extra
21
- conduit-parse
22
- hie-bios
23
- yaml
24
- ]
25
- else if compiler == "ghc865" then [ ] else
26
- # compiler = ghc88
27
- [ haskell-lsp
28
- lsp-test
29
- brittany
30
- ormolu
31
- stylish-haskell
32
- ] ;
13
+ let haskellPackagesForProject = p :
14
+ if compiler == "default" || compiler == "ghc883"
15
+ then haskellPackages . ghcWithPackages p
16
+ # for all other compilers there is no Nix cache so dont bother building deps with NIx
17
+ else haskell . packages . ${ compiler } . ghcWithPackages [ ] ;
33
18
34
19
compilerWithPackages = haskellPackagesForProject ( p :
35
20
with p ;
36
- [ aeson
21
+ [
22
+ Diff
23
+ Glob
24
+ HsYAML-aeson
25
+ QuickCheck
26
+ aeson
37
27
alex
38
28
async
39
29
base16-bytestring
40
30
blaze-builder
41
31
blaze-markup
32
+ brittany
33
+ conduit-extra
34
+ conduit-parse
42
35
cryptohash-sha1
43
36
data-default
44
37
data-default-class
45
38
data-default-instances-containers
46
39
data-default-instances-dlist
47
40
data-default-instances-old-locale
48
- Diff
49
41
extra
50
42
floskell
51
43
fuzzy
52
44
generic-deriving
53
45
ghc-check
54
46
gitrev
55
- Glob
56
47
haddock-library
57
48
happy
49
+ haskell-lsp
58
50
haskell-src-exts
51
+ hie-bios
59
52
hslogger
60
53
hspec
61
- HsYAML-aeson
62
54
lens
55
+ lsp-test
63
56
megaparsec
64
57
network
65
58
opentelemetry
66
59
optparse-simple
67
- QuickCheck
68
- parsers
60
+ ormolu
69
61
parser-combinators
62
+ parsers
70
63
prettyprinter
71
64
prettyprinter-ansi-terminal
72
65
primes
@@ -77,6 +70,7 @@ let haskellPackagesForProject = if compiler == "default"
77
70
shake
78
71
sorted-list
79
72
strict
73
+ stylish-haskell
80
74
tasty
81
75
tasty-ant-xml
82
76
tasty-expected-failure
@@ -89,8 +83,9 @@ let haskellPackagesForProject = if compiler == "default"
89
83
unix-compat
90
84
unordered-containers
91
85
xml
86
+ yaml
92
87
zlib
93
- ] ++ extraPackages p ) ;
88
+ ] ) ;
94
89
in
95
90
stdenv . mkDerivation {
96
91
name = "haskell-language-server" ;
0 commit comments