Use python packages in gdb-dashboard

https://github.com/cyrus-and/gdb-dashboard provide a prompt style for gdb. However, it cannot work for NixOS. Many python packages cannot be detected in gdb’s python port. Such as:

$ python -c 'import pygments'
$ gdb --batch --ex 'python import pygments'
Traceback (most recent call last):
  File "<string>", line 1, in <module>
ModuleNotFoundError: No module named 'pygments'
Error while executing Python code.

Anyone know any method to fix this problem for NixOS?

I notice gdb-dashboard will respect $PYTHONSTARTUP. We can add /run/current-system/sw/lib/python3.11/site-packages to sys.path.