git.iko.soy/typeable/nixpkgs
on master help sign in
neovim wrapper: add withNodeJs to build wrapper with nodejs support
commitda4a004193614945641c0a634855deec926b089b authorWael M. Nasreddine <wael.nasreddine@gmail.com> dateWed 7 Nov 2018, 12:38 (8 years ago) parent657e18e
1 file changed+8−1
pkgs/applications/editors/neovim/wrapper.nix+8−1
pkgs/applications/editors/neovim/wrapper.nix+8−1
@@ -1,6 +1,8 @@
11{ stdenv, lib, makeWrapper
22, vimUtils
33, bundlerEnv, ruby
4+, nodejs
5+, nodePackages
46, pythonPackages
57, python3Packages
68}:
@@ -12,6 +14,7 @@ let
1214 wrapper = {
1315 withPython ? true, extraPythonPackages ? (_: []) /* the function you would have passed to python.withPackages */
1416 , withPython3 ? true, extraPython3Packages ? (_: []) /* the function you would have passed to python.withPackages */
17+ , withNodeJs? false
1518 , withRuby ? true
1619 , withPyGUI ? false
1720 , vimAlias ? false
@@ -50,6 +53,8 @@ let
5053 ++ (extraPython3PackagesFun ps)
5154 ++ (concatMap (f: f ps) pluginPython3Packages));
5255
56+ binPath = makeBinPath (optionals withRuby [rubyEnv] ++ optionals withNodeJs [nodejs]);
57+
5358 in
5459 stdenv.mkDerivation {
5560 name = "neovim-${stdenv.lib.getVersion neovim}";
@@ -62,10 +67,12 @@ let
6267
6368 makeWrapper "$(readlink -v --canonicalize-existing "${bin}")" \
6469 "$out/bin/nvim" --add-flags " \
70+ --cmd \"${if withNodeJs then "let g:node_host_prog='${nodePackages.neovim}/bin/neovim-node-host'" else "let g:loaded_node_provider=1"}\" \
6571 --cmd \"${if withPython then "let g:python_host_prog='$out/bin/nvim-python'" else "let g:loaded_python_provider = 1"}\" \
6672 --cmd \"${if withPython3 then "let g:python3_host_prog='$out/bin/nvim-python3'" else "let g:loaded_python3_provider = 1"}\" \
6773 --cmd \"${if withRuby then "let g:ruby_host_prog='$out/bin/nvim-ruby'" else "let g:loaded_ruby_provider=1"}\" " \
68− ${optionalString withRuby '' --suffix PATH : ${rubyEnv}/bin --set GEM_HOME ${rubyEnv}/${rubyEnv.ruby.gemPath}'' }
74+ --suffix PATH : ${binPath} \
75+ ${optionalString withRuby '' --set GEM_HOME ${rubyEnv}/${rubyEnv.ruby.gemPath}'' }
6976
7077 ''
7178 + optionalString (!stdenv.isDarwin) ''