  
      if hasattr(sys, 'real_prefix'):
          prefixes.append(sys.real_prefix)
-@@ -1162,6 +1152,8 @@
+@@ -1078,6 +1068,8 @@ def change_prefix(filename, dst_prefix):
              if src_prefix != os.sep: # sys.prefix == "/"
                  assert relpath[0] == os.sep
                  relpath = relpath[1:]

             return join(dst_prefix, relpath)
     assert False, "Filename %s does not start with any of these prefixes: %s" % \
         (filename, prefixes)

Without this patch `virtualenv --python=python2.7 .` fails with an
error because it notices that the python readline.so is not in the
same path as python2.7. I assume this is to avoid copying the wrong
file on systems where it is possible to find incompatible libraries by
accident. Adding "/nix/store" to the prefix fixes this problem.

A sitecustomize.py is created in the virtualenv which makes libraries
from the python specified by the --python argument available to the
virtualenv. For example, this makes readline and sqlite3 available
when a wrapped python is specified. If no --python argument is passed,
it will only add the path to the python used when building
`virtualenv`, which is the unwrapped python, so sqlite3 won't be
available.


diff --git a/virtualenv.py b/virtualenv.py
index d3e76a7..cb307fa 100755
--- a/virtualenv.py
+++ b/virtualenv.py
@@ -1051,17 +1051,7 @@ def path_locations(home_dir):
 
 
 def change_prefix(filename, dst_prefix):
