Since the location of the ls command is hard-coded at /bin/ls/, this extension won't work on NixOS, which has different locations for these commands. (which ls for me reports /run/current-system/sw/bin/ls).
I think a solution to this would be to replace the function which runs /bin/ls with one that just runs ls, which should be locatable by subprocess, I imagine.
FWIW, if another NixOS user sees this, a dirty workaround is to run sudo ln -s which ls /bin/ls.