-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathshell.nix
executable file
·83 lines (75 loc) · 2.13 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
with import <nixpkgs> { };
let
pythonPackages = python3Packages;
xrt =
let
pname = "xrt";
version = "1.6.0";
extension = "zip";
in
python3Packages.buildPythonPackage {
inherit pname version;
src = fetchPypi {
inherit pname version extension;
sha256 = "1a2e19306abd67a4b45c8b9c4e05d7fb2d8a5836b82e08749d935bf4314599dc";
};
doCheck = false;
};
in
pkgs.mkShell rec {
name = "skif-xrt";
venvDir = "./.venv";
nativeBuildInputs = [ qt5.qttools.dev cmake ];
buildInputs = [
# adaptive deps
pythonPackages.python
pythonPackages.venvShellHook
pythonPackages.numpy
pythonPackages.scipy
pythonPackages.pandas
pythonPackages.ipykernel
pythonPackages.ipywidgets
pythonPackages.pyviz-comms
pythonPackages.bokeh
pythonPackages.mpi4py
pythonPackages.cmake
pythonPackages.scikit-build
pythonPackages.selenium
stdenv
# xrt deps
pythonPackages.matplotlib
pythonPackages.pyqtwebengine
pythonPackages.pyqt5
pythonPackages.setuptools
pythonPackages.pyopencl
pythonPackages.pyopengl
pythonPackages.pyopengl-accelerate
pythonPackages.colorama
xrt
# my deps
pythonPackages.gitpython
pythonPackages.uncertainties
pythonPackages.plotly
];
# Run this command, only after creating the virtual environment
postVenvCreation = ''
unset SOURCE_DATE_EPOCH
pip install --upgrade pip
pip install jupyterlab
pip install ipympl
pip install "adaptive[notebook]"
jupyter labextension install @jupyter-widgets/jupyterlab-manager
jupyter labextension install @pyviz/jupyterlab_pyviz
python -m ipykernel install --user --name=${name}
'';
# Now we can execute any commands within the virtual environment.
# This is optional and can be left out to run pip manually.
postShellHook = ''
# allow pip to install wheels
unset SOURCE_DATE_EPOCH
'';
QT_QPA_PLATFORM_PLUGIN_PATH="${qt5.qtbase.bin}/lib/qt-${qt5.qtbase.version}/plugins";
LD_LIBRARY_PATH = "${pkgs.stdenv.cc.cc.lib}/lib";
PYTHONPATH=builtins.getEnv "PWD";
BASE_DIR=builtins.getEnv "PWD";
}