From 10436a707a45f540e10d6b0cb5a2c075dff1fc66 Mon Sep 17 00:00:00 2001 From: Symphorien Gibol Date: Wed, 11 Jul 2018 17:05:51 +0200 Subject: [PATCH] neovim wrapper: do not unset PYTHONPATH This solves the following bug: opening neovim in nix-shell -p pythonPackages.numpy does not enable to run successfully :!python -c "import numpy" because the PYTHONPATH is wiped by the neovim wrapper. This wiping is necessary for the python providers, though, otherwise a python2 nix-shell will make the python3 provider read python2 files. We wrap the providers only, instead of neovim as whole. --- pkgs/applications/editors/neovim/wrapper.nix | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/pkgs/applications/editors/neovim/wrapper.nix b/pkgs/applications/editors/neovim/wrapper.nix index fa060325559..a57831ba03c 100644 --- a/pkgs/applications/editors/neovim/wrapper.nix +++ b/pkgs/applications/editors/neovim/wrapper.nix @@ -63,7 +63,6 @@ let --cmd \"${if withPython then "let g:python_host_prog='$out/bin/nvim-python'" else "let g:loaded_python_provider = 1"}\" \ --cmd \"${if withPython3 then "let g:python3_host_prog='$out/bin/nvim-python3'" else "let g:loaded_python3_provider = 1"}\" \ --cmd \"${if withRuby then "let g:ruby_host_prog='$out/bin/nvim-ruby'" else "let g:loaded_ruby_provider=1"}\" " \ - --unset PYTHONPATH \ ${optionalString withRuby '' --suffix PATH : ${rubyEnv}/bin --set GEM_HOME ${rubyEnv}/${rubyEnv.ruby.gemPath}'' } '' @@ -75,9 +74,9 @@ let --replace 'Name=Neovim' 'Name=WrappedNeovim' '' + optionalString withPython '' - ln -s ${pythonEnv}/bin/python $out/bin/nvim-python + makeWrapper ${pythonEnv}/bin/python $out/bin/nvim-python --unset PYTHONPATH '' + optionalString withPython3 '' - ln -s ${python3Env}/bin/python3 $out/bin/nvim-python3 + makeWrapper ${python3Env}/bin/python3 $out/bin/nvim-python3 --unset PYTHONPATH '' + optionalString withRuby '' ln -s ${rubyEnv}/bin/neovim-ruby-host $out/bin/nvim-ruby ''