Python virtualenv from nix is not working on Centos

I am trying to use a closed-source application that needs virtualenv under the hood. I am on Centos with Nix. I have the standard python.withPackages, etc. installed in the default environment and I pointed the application to that python. The application calls python but virtualenv fails:

ERROR: The executable /some/path/python/env/bin/python3.7 is not functioning
ERROR: It thinks sys.prefix is '/nix/store/jgchxgjsz98lafvzwhzmyl9w7pm4ai0c-python3-3.7.9-env' (should be '/some/path/python-environments/pip/3.7.9/qu9vo9ZrcjUIxdgh4Mlc8g')
ERROR: virtualenv is not compatible with this system or executable

It looks like I am seeing this issue Python virtualenv not working because of sys.prefix mismatch · Issue #66366 · NixOS/nixpkgs · GitHub.

What is your default.nix or shell.nix?