-
Notifications
You must be signed in to change notification settings - Fork 42
Expand file tree
/
Copy pathshell.nix
More file actions
59 lines (55 loc) · 1.26 KB
/
shell.nix
File metadata and controls
59 lines (55 loc) · 1.26 KB
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
{
pkgs ? import ./nixpkgs.nix { },
ghcAttr ? "ghc9122",
}:
let
inherit (pkgs)
cabal-install
fetchpatch
fetchurl
haskell
python3
rPackages
rWrapper
stdenv
zeromq
zlib
;
inherit (pkgs.lib) lists strings versions;
# Set enableStrictBarrier to true to build HaskellR against a version of R with
# the --enable-strict-barrier configure flag enabled for better memory
# diagnostics.
R = pkgs.R.override { enableStrictBarrier = false; };
rEnv = rWrapper.override {
inherit R;
# ggplot2 is required for ./IHaskell/examples/tutorial-ihaskell-inline-r.ipynb
packages = with rPackages; [ ggplot2 ];
};
python3Env = python3.withPackages (
ps: with ps; [
ipython
jupyter_client
notebook
]
);
in
haskell.lib.buildStackProject {
name = "HaskellR";
ghc = pkgs.haskell.compiler.${ghcAttr};
buildInputs = [
cabal-install
python3Env
rEnv
zeromq
zlib
pkgs.libsodium
];
nativeBuildInputs = with pkgs; [
pkg-config
];
LANG = "en_US.UTF-8";
# NOTE: Workaround https://ghc.haskell.org/trac/ghc/ticket/11042.
${(strings.optionalString stdenv.isDarwin "DY") + "LD_LIBRARY_PATH"} = [
("${R}/lib/R" + (strings.optionalString stdenv.isDarwin "/lib"))
];
}