forked from wd15/PyCahnHilliard
-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
44 lines (40 loc) · 1.17 KB
/
flake.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
{
description = "simple python environment";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-23.05";
utils.url = "github:numtide/flake-utils";
};
outputs = { self, nixpkgs, utils }: (utils.lib.eachSystem ["x86_64-linux" ] (system:
let
pkgs = nixpkgs.legacyPackages.${system};
pypkgs = pkgs.python3Packages;
pyenv = pkgs.mkShell rec {
pname = "simple";
nativeBuildInputs = with pypkgs; [
scipy
numpy
matplotlib
tkinter
pandas
jupyterlab
notebook
numba
joblib
];
shellHook = ''
# export NIX_SSL_CERT_FILE=/etc/ssl/certs/ca-certificates.crt
# export OMPI_MCA_plm_rsh_agent=${pkgs.openssh}/bin/ssh
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
export TK_LIBRARY="${pkgs.tk}/lib/${pkgs.tk.libPrefix}"
'';
};
in
{
devShells.default = pyenv;
}
));
}