-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
51 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
use nix | ||
layout python3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
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 | ||
qt5.full | ||
qtcreator | ||
python3 | ||
python3Packages.pyqt5 | ||
python3Packages.gdal | ||
python3Packages.pytest | ||
|
||
# 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 | ||
''; | ||
|
||
} |