diff --git a/pkgs/development/interpreters/python/wrapper.nix b/pkgs/development/interpreters/python/wrapper.nix index 65b949661b0..71e9e614352 100644 --- a/pkgs/development/interpreters/python/wrapper.nix +++ b/pkgs/development/interpreters/python/wrapper.nix @@ -6,8 +6,7 @@ # Create a python executable that knows about additional packages. let recursivePthLoader = import ../../python-modules/recursive-pth-loader/default.nix { stdenv = stdenv; python = python; }; - env = ( - let + env = let paths = stdenv.lib.closePropagation (extraLibs ++ [ python recursivePthLoader ] ) ; in buildEnv { name = "${python.name}-env"; @@ -36,19 +35,21 @@ let done '' + postBuild; - passthru.env = stdenv.mkDerivation { - name = "interactive-${python.name}-environment"; - nativeBuildInputs = [ env ]; - - buildCommand = '' - echo >&2 "" - echo >&2 "*** Python 'env' attributes are intended for interactive nix-shell sessions, not for building! ***" - echo >&2 "" - exit 1 - ''; - }; - }) // { - inherit python; inherit (python) meta; + + passthru = python.passthru // { + interpreter = "${env}/bin/${python.executable}"; + env = stdenv.mkDerivation { + name = "interactive-${python.name}-environment"; + nativeBuildInputs = [ env ]; + + buildCommand = '' + echo >&2 "" + echo >&2 "*** Python 'env' attributes are intended for interactive nix-shell sessions, not for building! ***" + echo >&2 "" + exit 1 + ''; + }; + }; }; in env