diff --git a/pkgs/applications/editors/neovim/wrapper.nix b/pkgs/applications/editors/neovim/wrapper.nix index 568043f96687..bd4304560fd1 100644 --- a/pkgs/applications/editors/neovim/wrapper.nix +++ b/pkgs/applications/editors/neovim/wrapper.nix @@ -1,6 +1,8 @@ { stdenv, lib, makeWrapper , vimUtils , bundlerEnv, ruby +, nodejs +, nodePackages , pythonPackages , python3Packages }: @@ -12,6 +14,7 @@ let wrapper = { withPython ? true, extraPythonPackages ? (_: []) /* the function you would have passed to python.withPackages */ , withPython3 ? true, extraPython3Packages ? (_: []) /* the function you would have passed to python.withPackages */ + , withNodeJs? false , withRuby ? true , withPyGUI ? false , vimAlias ? false @@ -50,6 +53,8 @@ let ++ (extraPython3PackagesFun ps) ++ (concatMap (f: f ps) pluginPython3Packages)); + binPath = makeBinPath (optionals withRuby [rubyEnv] ++ optionals withNodeJs [nodejs]); + in stdenv.mkDerivation { name = "neovim-${stdenv.lib.getVersion neovim}"; @@ -62,10 +67,12 @@ let makeWrapper "$(readlink -v --canonicalize-existing "${bin}")" \ "$out/bin/nvim" --add-flags " \ + --cmd \"${if withNodeJs then "let g:node_host_prog='${nodePackages.neovim}/bin/neovim-node-host'" else "let g:loaded_node_provider=1"}\" \ --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"}\" " \ - ${optionalString withRuby '' --suffix PATH : ${rubyEnv}/bin --set GEM_HOME ${rubyEnv}/${rubyEnv.ruby.gemPath}'' } + --suffix PATH : ${binPath} \ + ${optionalString withRuby '' --set GEM_HOME ${rubyEnv}/${rubyEnv.ruby.gemPath}'' } '' + optionalString (!stdenv.isDarwin) ''