Still no success with with flakes (at least not when pyqt6-webengine is included), even after hours including the xth libraries and debugging…
But my newest approach works with setting PYTHONHOME (thanks to the idea from here):
- Make nix-shell including packages:
nix-shell -p 'python312.withPackages (p: [ p.pyqt6 p.pyqt6-webengine ])' - Create venv including site packages:
python -m venv --system-site-packages .venv - Activate:
. .venv/bin/activate - Get derivation path:
which python(e.g./nix/store/am5...-python3-3.12.12-env/bin/python) - Set PYTHONHOME to the env:
export PYTHONHOME=/nix/store/am5...-python3-3.12.12-env(excluding /bin/python) - Voila! Feel free to install additional packages with pip