I tried to make a venv with --system-site-packages and install it via pip, but PyQt6 is not available in the venv and also can not be installed in a venv on nixos… Any solutions?
There is probably a way to convince the venv to use our wrapped interpreter with the special variable to load the system packages. Other than that you could package the git dependency locally in the shell file.
Solution: So i came up with this (ugly) hack that seems to work:
Make your shell.nix (with dependencies like python-pkgs.pyqt6 from the nix store as I did above) and open the shell
Find out where the packages are located with python -m site. In my case it was something like /nix/store/vy...44-python3-3.11.9-env/lib/python3.11/site-packages
Create a venv with python -m venv .venv and activate it
Copy the system packages to your venv with cp -P -r /nix/store/vy...44-python3-3.11.9-env/lib/python3.11/site-packages/* .venv/lib/python3.11/site-packages/ (the -P is for copying the symlinks rather than dereferencing it)
(btw, I also tried pip2nix but it didn’t work as well with a git+url and the fact that such tools as pypi2nix, python2nix, nix-pip, mach-nix keep popping up and get abandoned/discontinued makes developing Python on nixos still a pain in the a**)