forked from hasktorch/hasktorch
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathshell.nix
42 lines (35 loc) · 892 Bytes
/
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
{ cudaSupport
, cudaMajorVersion
, hasktorchProject
, torch
, utillinux
, lib
, tokenizers-haskell
#, preCommitShellHook
}:
hasktorchProject.shellFor {
name = "hasktorch-dev-shell";
exactDeps = true;
withHoogle = true;
tools = {
cabal = "latest";
haskell-language-server = "latest";
};
# packages = ps: with ps; [ ];
# buildInputs = with haskellPackages; [ ];
shellHook = lib.strings.concatStringsSep "\n" [
# set dynamic libraries for cuda support
(lib.optionalString cudaSupport "export LD_LIBRARY_PATH=\"$LD_LIBRARY_PATH:/run/opengl-driver/lib\"")
# put tokenizers on path
"export LD_LIBRARY_PATH=\"$LD_LIBRARY_PATH:${tokenizers-haskell}/lib\""
# make sure number of processes is set
''
case "$(uname)" in
"Linux")
${utillinux}/bin/taskset -pc 0-1000 $$
;;
esac
''
# preCommitShellHook
];
}