How can I use GDB for Python in NixOS?

Python has GDB support, but I cannot figure out how I can use it in NixOS, there seems no such a package in nixpkgs

Do you mean you want to debug Python’s interpreter’s internals while running a Python script? If the answer is yes, it seems you simply need to launch gdb python <script>, and if you are missing debug info of the python executable, I’d try to do what’s in this example:

https://nixos.org/manual/nixpkgs/unstable/#stdenv-separateDebugInfo

I mean the python-gdb extension, which allows for python specific subcommands to be used inside gdb.