forked from infobyte/faraday
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathshell.nix
39 lines (33 loc) · 1.1 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
with (import <nixpkgs> {});
let
in
mkShell {
buildInputs = with python27Packages;
[virtualenv pyopenssl psycopg2 pillow pygobject3 pynacl matplotlib lxml ldap
gobjectIntrospection gtk3 gnome3.vte ipython
];
shellHook = ''
unset SOURCE_DATE_EPOCH # Required to make pip work
mkvirtualenv(){
# Reset previous virtualenv
type -t deactivate && deactivate
rm -rf venv
# Build new virtualenv with system packages
virtualenv --system-site-packages venv
source venv/bin/activate
pip install -r requirements_server.txt
pip install -r requirements.txt
pip install -r requirements_dev.txt
}
if [[ -d venv ]]; then
source venv/bin/activate
else
echo Creating new virtualenv
mkvirtualenv
fi
# Without this, the import report dialog of the client breaks
# Taken from https://github.com/NixOS/nixpkgs/pull/26614
export XDG_DATA_DIRS=$XDG_ICON_DIRS:$GSETTINGS_SCHEMAS_PATH\''${XDG_DATA_DIRS:+:}\$XDG_DATA_DIRS
alias c="PS1= python faraday.py"
'';
}