forked from ceridwen/macropy
-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathshell.nix
More file actions
32 lines (31 loc) · 720 Bytes
/
shell.nix
File metadata and controls
32 lines (31 loc) · 720 Bytes
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
with import <nixpkgs> {};
with pkgs.python36Packages;
stdenv.mkDerivation {
name = "impurePythonEnv";
buildInputs = [
# these packages are required for virtualenv and pip to work:
#
python37Full
python37Packages.virtualenv
python37Packages.pip
];
src = null;
shellHook = ''
# set SOURCE_DATE_EPOCH so that we can use python wheels
SOURCE_DATE_EPOCH=$(date +%s)
if ! [ -e env ]; then
newenv=1
python -m venv --system-site-packages --prompt macropy env
else
newenv=
fi
export PATH=$PWD/env/bin:$PATH
if ! [ -z $newenv ]; then
pip install -r requirements.txt
fi
if [ "x(raccoon) " != x ] ; then
PS1="(macropy) $PS1"
fi
export PS1
'';
}