Looks like it’s an open bug: [python] ctypes.util.find_library should return full path to the library · Issue #7307 · NixOS/nixpkgs · GitHub
In that case, the way to fix this currently is something like this:
postPatchPhase = ''
sed -i 's|ctypes.util.find_library("X11")|"${xorg.libX11}/lib/libX11.so"|' mss/linux.py
'';
This is a bit horrible
You can also try setting DYLD_LIBRARY_PATH="${lib.makeLibraryPath propagatedBuildInputs}";
, but it seems that people on the issue aren’t getting results from that.