-
Notifications
You must be signed in to change notification settings - Fork 6
/
default.nix
51 lines (44 loc) · 1.21 KB
/
default.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
with import <nixpkgs> { };
let
pythonPackages = python3Packages;
in pkgs.mkShell rec {
name = "impurePythonEnv";
venvDir = "./.venv";
buildInputs = [
# A Python interpreter including the 'venv' module is required to bootstrap
# the environment.
pythonPackages.python
pylint
black
python311Packages.future
qgis
vscode
xorg.libxcb
qgis
#qgis.override { extraPythonPackages = ps: [ ps.numpy ps.future ps.geopandas ps.rasterio ];}
qt5.full
qtcreator
python3
python3Packages.pyqt5
python3Packages.gdal
python3Packages.pytest
zip
# This executes some shell code to initialize a venv in $venvDir before
# dropping into the shell
];
# Run this command, only after creating the virtual environment
postVenvCreation = ''
unset SOURCE_DATE_EPOCH
pip install -r requirements.txt
'';
shellHook = ''
export PYTHONPATH=$PYTHONPATH:`which qgis`/../../share/qgis/python
export QT_QPA_PLATFORM=offscreen
'';
# Now we can execute any commands within the virtual environment.
# This is optional and can be left out to run pip manually.
postShellHook = ''
# allow pip to install wheels
unset SOURCE_DATE_EPOCH
'';
}