Skip to content

Commit 4e6082f

Browse files
authored
Merge pull request #240 from pepeiborra/shell-nix
Shell nix further steps
2 parents c609be8 + d286ae8 commit 4e6082f

File tree

1 file changed

+60
-5
lines changed

1 file changed

+60
-5
lines changed

shell.nix

Lines changed: 60 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,91 @@
1+
# This shell.nix file is designed for use with cabal build
2+
# It aims to leverage the nix cache in as much as possible
3+
# while reducing Nix maintenance costs.
4+
# It does **not** aim to replace Cabal/Stack with Nix
5+
6+
17
{ sources ? import nix/sources.nix,
28
nixpkgs ? import sources.nixpkgs {},
39
compiler ? "default"
410
}:
511
with nixpkgs;
612

7-
let haskellPackagesForProject = if compiler == "default"
8-
then haskellPackages.ghcWithPackages
9-
else haskell.packages.${compiler}.ghcWithPackages;
13+
let defaultCompiler = "ghc" + lib.replaceStrings ["."] [""] haskellPackages.ghc.version;
14+
haskellPackagesForProject = p:
15+
if compiler == "default" || compiler == defaultCompiler
16+
then haskellPackages.ghcWithPackages p
17+
# for all other compilers there is no Nix cache so dont bother building deps with NIx
18+
else haskell.packages.${compiler}.ghcWithPackages [];
1019

1120
compilerWithPackages = haskellPackagesForProject(p:
1221
with p;
13-
[ aeson
22+
[
23+
Diff
24+
Glob
25+
HsYAML-aeson
26+
QuickCheck
27+
aeson
28+
alex
1429
async
30+
base16-bytestring
31+
blaze-builder
32+
blaze-markup
33+
brittany
34+
conduit-extra
35+
conduit-parse
36+
cryptohash-sha1
37+
data-default
38+
data-default-class
39+
data-default-instances-containers
40+
data-default-instances-dlist
41+
data-default-instances-old-locale
1542
extra
43+
floskell
44+
fuzzy
45+
generic-deriving
46+
ghc-check
1647
gitrev
48+
haddock-library
49+
happy
1750
haskell-lsp
51+
haskell-src-exts
52+
hie-bios
53+
hslogger
54+
hspec
1855
lens
56+
lsp-test
57+
megaparsec
1958
network
59+
opentelemetry
2060
optparse-simple
61+
ormolu
62+
parser-combinators
63+
parsers
2164
prettyprinter
22-
QuickCheck
65+
prettyprinter-ansi-terminal
66+
primes
67+
psqueues
2368
regex-tdfa
2469
rope-utf16-splay
2570
safe-exceptions
2671
shake
72+
sorted-list
73+
strict
74+
stylish-haskell
2775
tasty
76+
tasty-ant-xml
77+
tasty-expected-failure
2878
tasty-golden
2979
tasty-hunit
3080
tasty-rerun
3181
temporary
3282
text
83+
typed-process
84+
unix-compat
3385
unordered-containers
86+
xml
87+
yaml
88+
zlib
3489
]);
3590
in
3691
stdenv.mkDerivation {

0 commit comments

Comments
 (0)