Add flag to disable PYTHONNOUSERSITE for wrapped binaries in python environments

This commit is contained in:
Tom McLaughlin
2019-05-13 02:56:56 -07:00
parent 0045164b15
commit a3f24daa7b
3 changed files with 4 additions and 4 deletions
@@ -47,7 +47,7 @@
, dontWrapPythonPrograms ? false
# Skip setting the PYTHONNOUSERSITE environment variable in wrapped programs
, skipNoUserSite ? false
, permitUserSite ? false
# Remove bytecode from bin folder.
# When a Python script has the extension `.py`, bytecode is generated
@@ -96,7 +96,6 @@ let self = toPythonModule (python.stdenv.mkDerivation (builtins.removeAttrs attr
installCheckInputs = checkInputs;
postFixup = lib.optionalString (!dontWrapPythonPrograms) ''
${if skipNoUserSite then "export SKIPNOUSERSITE=1" else ""}
wrapPythonPrograms
'' + lib.optionalString removeBinBytecode ''
if [ -d "$out/bin" ]; then