-
Notifications
You must be signed in to change notification settings - Fork 145
/
shell.nix
61 lines (52 loc) · 1.69 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
#
# $ nix-shell --pure --argstr tag 20.09
#
{
tag ? "22.11"
}:
let
pkgs = import (builtins.fetchTarball "https://github.com/NixOS/nixpkgs/archive/${tag}.tar.gz") {};
pypkgs = pkgs.python3Packages;
jupyter_extra = with pypkgs; [
ipython
ipykernel
traitlets
notebook
widgetsnbextension
ipywidgets
(if pkgs.stdenv.isDarwin then pypkgs.jupyter else pypkgs.jupyterlab)
];
in
(pypkgs.fipy.overridePythonAttrs (old: rec {
src = pkgs.lib.cleanSource ./.;
nativeBuildInputs = with pypkgs; [
pip
pkgs.imagemagick
pkgs.git
pkgs.openssh
nbval
] ++ propagatedBuildInputs ++ jupyter_extra;
propagatedBuildInputs = old.propagatedBuildInputs;
postShellHook = ''
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:$(pwd)
export PATH=$PATH:$PYTHONUSERBASE/bin
export OMPI_MCA_plm_rsh_agent=${pkgs.openssh}/bin/ssh
## To build the docs (don't use --pure)
# Need latex to build properly
#
# texlive-latex-base, texlive-fonts-recommended, texlive-fonts-extra
# texlive-latex-extra, texlive-science, texlive-extra-utils
#
# pip install --user sphinx
# pip install --user "sphinxcontrib-bibtex<=0.4.2"
# pip install --user git+https://github.com/thewtex/sphinx-contrib.git#subdirectory=traclinks
# required for embedded plots in documentation
# pip install --user pandas
# python setup.py build_docs --html
## To build PyAMG add nixpkgs.gcc to nativeBuildInputs and then
# pip install --user pyamg
'';
}))