It seems like python may not be compiled with libffi which causes some simple libraries like psutil to fail.
Maybe it's possible to add libffi in as a dependency?
File "/nix/store/sv2q89gvjq2h05q5qa48k1vw8j33kr0a-python3-3.7.9/lib/python3.7/ctypes/__init__.py", line 7, in <module>
from _ctypes import Union, Structure, Array
ModuleNotFoundError: No module named '_ctypes'
Using python 3.7.9