-
Notifications
You must be signed in to change notification settings - Fork 30
/
shell.nix
149 lines (126 loc) · 3.06 KB
/
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
# Usage:
#
# $ nix-shell --pure --argstr version 2022.1.10 --argstr tag 20.09
#
{
tag ? "22.05",
version ? "2022.7.17"
}:
let
pkgs = import (builtins.fetchTarball "https://github.com/NixOS/nixpkgs/archive/${tag}.tar.gz") {};
pypkgs = pkgs.python3Packages;
nbqa = pypkgs.buildPythonPackage rec {
pname = "nbqa";
version = "1.3.1";
src = pypkgs.fetchPypi {
inherit pname version;
sha256 = "sha256-66fz00k8ZCmww/ladkBnsrAHdF9ykDcphVCmFle/7F4=";
};
propagatedBuildInputs = with pypkgs; [ ipython tomli tokenize-rt ];
};
dgl = pypkgs.buildPythonPackage rec {
pname = "dgl";
version = "0.9.0";
format = "wheel";
src = pypkgs.fetchPypi rec {
inherit pname version format;
sha256 = "sha256-k+BPwi8/H8NP7Fp/AliuUaXcxoTxGoM6gGNyFLxW9Jg=";
dist = "cp39";
python = "cp39";
abi = "cp39";
platform = "manylinux1_x86_64";
};
propagatedBuildInputs = with pypkgs; [
tqdm
numpy
networkx
psutil
scipy
requests
];
doCheck = false;
};
matminer = pypkgs.buildPythonPackage rec {
pname = "matminer";
version = "0.6.5";
src = pypkgs.fetchPypi {
inherit pname version;
sha256 = "sha256-RRGJZdaNzyMxAMig+aU5Txu6ELfW4oKJcjuut3HeaqE=";
};
nativeBuildInputs = with pypkgs; [
monty
sympy
requests
future
plotly
numpy
scikit-learn
pymongo
jsonschema
pint
pymatgen
];
propagatedBuildInputs = nativeBuildInputs;
postPatch = ''
rm requirements-optional.txt
touch requirements-optional.txt
'';
doCheck = false;
};
jarvisversion = version;
jarvistools = pypkgs.buildPythonPackage rec {
pname = "jarvis-tools";
version = jarvisversion;
src = pypkgs.fetchPypi {
inherit pname version;
sha256 = "sha256-WmF3IBvM6Bje1TEIXWOjNV5Bw2bpkWJ3+ZI5k55lOCU=";
};
propagatedBuildInputs = with pypkgs; [
joblib
flask
numpy
phonopy
scipy
matplotlib
spglib
requests
toolz
pytest
bokeh
networkx
xmltodict
tqdm
pandas
pytorch
dgl
];
doCheck = false;
};
nixes_src = builtins.fetchTarball "https://github.com/wd15/nixes/archive/9a757526887dfd56c6665290b902f93c422fd6b1.zip";
jupyter_extra = pypkgs.callPackage "${nixes_src}/jupyter/default.nix" {
jupyterlab=(if pkgs.stdenv.isDarwin then pypkgs.jupyter else pypkgs.jupyterlab);
};
in
pkgs.mkShell rec {
pname = "jarvis-notebooks";
nativeBuildInputs = with pypkgs; [
jupyter
jupyter_extra
jarvistools
nbqa
pip
matminer
plotly
nbval
pytest
black
pylint
];
shellHook = ''
SOURCE_DATE_EPOCH=$(date +%s)
export PYTHONUSERBASE=$PWD/.local
export USER_SITE=`python -c "import site; print(site.USER_SITE)"`
export PYTHONPATH=$PYTHONPATH:$USER_SITE
export PATH=$PATH:$PYTHONUSERBASE/bin
'';
}