nixos-shell will inherit the TERM variable from the user environment which leads to a broken terminal in some situations.
For example, I have TERM=rxvt-unicode-256color, which is inherited and leads to a broken terminal. Probably because rxvt_unicode is not in the system packages?