forked from idris-lang/Idris-dev
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstack-shell.nix
More file actions
31 lines (24 loc) · 739 Bytes
/
stack-shell.nix
File metadata and controls
31 lines (24 loc) · 739 Bytes
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
with (import <nixpkgs> {});
let
# MUST match resolver in stack.yaml
resolver = haskell.packages.lts-9_0.ghc;
native_libs = [
libffi
zlib
ncurses
gmp
pkgconfig
] ++ lib.optionals stdenv.isDarwin (with darwin.apple_sdk.frameworks; [
Cocoa
CoreServices
]);
in stdenv.mkDerivation {
name = "idrisBuildEnv";
buildInputs = [ resolver ] ++ native_libs;
STACK_IN_NIX_EXTRA_ARGS = builtins.foldl'
(acc: lib:
" --extra-lib-dirs=${lib}/lib --extra-include-dirs=${lib}/include" + acc)
"" native_libs;
# Needed if one wants to use ghci, due to https://ghc.haskell.org/trac/ghc/ticket/11042
LD_LIBRARY_PATH = builtins.concatStringsSep ":" (map (lib: lib.out + "/lib") native_libs);
}