-
Notifications
You must be signed in to change notification settings - Fork 0
/
shell.nix
97 lines (83 loc) · 2.76 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
{
pkgs ? import (builtins.fetchTarball {
name = "nixpkgs-unstable-2022-04-14";
url = "https://github.com/nixos/nixpkgs/archive/6361b4941a69395ebf15e6e56b142765fce850f9.tar.gz";
sha256 = "1lzi51c5a2wrhvmv255qajlkba5f6j4pfvidlrh9r004snpw5ikj";
}) {}
}:
let
name = "paravision";
my-python = pkgs.python3;
python-with-my-packages = my-python.withPackages (p: with p; [
numpy
rich
ruamel-yaml
GitPython
matplotlib
addict
fuzzywuzzy
]);
## Override paraview to run headless because openGL in nix can be a pain
## for non-NixOS.
paraview = pkgs.paraview.overrideAttrs ( oldAttrs: rec {
cmakeFlags = [
"-DCMAKE_BUILD_TYPE=Release"
"-DPARAVIEW_ENABLE_FFMPEG=ON"
"-DPARAVIEW_ENABLE_XDMF3=ON"
"-DPARAVIEW_INSTALL_DEVELOPMENT_FILES=ON"
"-DPARAVIEW_USE_MPI=ON"
"-DPARAVIEW_USE_PYTHON=ON"
"-DVTK_SMP_IMPLEMENTATION_TYPE=TBB"
"-DVTK_OPENGL_HAS_OSMESA=ON"
"-DVTK_USE_X=OFF"
"-DVTKm_ENABLE_MPI=ON"
"-DCMAKE_INSTALL_LIBDIR=lib"
"-DCMAKE_INSTALL_INCLUDEDIR=include"
"-DCMAKE_INSTALL_BINDIR=bin"
"-GNinja"
];
buildInputs = oldAttrs.buildInputs ++ [
pkgs.mesa
pkgs.mesa.osmesa
];
});
in pkgs.mkShell rec {
inherit name;
# paravision = pkgs.python3Packages.buildPythonPackage{
# pname = name;
# version = "0.1";
#
# src = ./.;
#
# propagatedBuildInputs = with pkgs; [
# python3Packages.numpy
# python3Packages.rich
# python3Packages.ruamel-yaml
# python3Packages.GitPython
# python3Packages.matplotlib
# python3Packages.addict
# python3Packages.fuzzywuzzy
# which
# ];
#
# doCheck = false;
# };
buildInputs = with pkgs; [
# paravision
python-with-my-packages
paraview
openssh # For something related to openmpi/MCA/ORTE
];
shellHook = ''
# Tells pip to put packages into $PIP_PREFIX instead of the usual locations.
# See https://pip.pypa.io/en/stable/user_guide/#environment-variables.
export PIP_PREFIX=$(pwd)/_build/pip_packages
export PYTHONPATH="$PIP_PREFIX/${pkgs.python3.sitePackages}:$PYTHONPATH"
export PYTHONPATH="${paraview}/lib/python3.9/site-packages:$PYTHONPATH"
PYTHONPATH=${python-with-my-packages}/${python-with-my-packages.sitePackages}:$PYTHONPATH
export PYTHONPATH="$(pwd):$PYTHONPATH"
export PATH="$(pwd):$PATH"
export PATH="$PIP_PREFIX/bin:$PATH"
unset SOURCE_DATE_EPOCH
'';
}