-
Notifications
You must be signed in to change notification settings - Fork 0
/
shell.nix
34 lines (29 loc) · 998 Bytes
/
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
{ pkgs ? import <nixpkgs> {} }:
pkgs.mkShell {
shellHook = ''
function initPipenvIfNeeded {
if ! pipenv --venv > /dev/null 2>&1 ;then
pipenv install --dev
fi
}
function loadPipenv {
export loadPipenvDepth=$(expr $loadPipenvDepth + 1)
initPipenvIfNeeded
source "$(pipenv --venv)/bin/activate"
if ! python -c "" ;then
if [ $loadPipenvDepth -gt 3 ] ;then
echo "Could not load pipenv after 3 tries."
exit 1
fi
pipenv --rm
loadPipenv
fi
}
loadPipenv || exit
unset loadPipenvDepth
export FLASK_APP=ums_api
export FLASK_DEBUG=1 # to enable autoreload
export MODE=debug
flask create_db
'';
}