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.
I know this is not an answer to your direct question, but if you don’t need to debug the native code (only the python side), then python3 -m pdb (pdb — The Python Debugger — Python 3.13.1 documentation) is very useful and works fine on Nix.