mirror of
https://github.com/SebastianWendel/nixpkgs.git
synced 2024-09-22 05:19:00 +02:00
neovim wrapper: add withNodeJs to build wrapper with nodejs support
This commit is contained in:
parent
657e18e011
commit
da4a004193
|
@ -1,6 +1,8 @@
|
||||||
{ stdenv, lib, makeWrapper
|
{ stdenv, lib, makeWrapper
|
||||||
, vimUtils
|
, vimUtils
|
||||||
, bundlerEnv, ruby
|
, bundlerEnv, ruby
|
||||||
|
, nodejs
|
||||||
|
, nodePackages
|
||||||
, pythonPackages
|
, pythonPackages
|
||||||
, python3Packages
|
, python3Packages
|
||||||
}:
|
}:
|
||||||
|
@ -12,6 +14,7 @@ let
|
||||||
wrapper = {
|
wrapper = {
|
||||||
withPython ? true, extraPythonPackages ? (_: []) /* the function you would have passed to python.withPackages */
|
withPython ? true, extraPythonPackages ? (_: []) /* the function you would have passed to python.withPackages */
|
||||||
, withPython3 ? true, extraPython3Packages ? (_: []) /* 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
|
, withRuby ? true
|
||||||
, withPyGUI ? false
|
, withPyGUI ? false
|
||||||
, vimAlias ? false
|
, vimAlias ? false
|
||||||
|
@ -50,6 +53,8 @@ let
|
||||||
++ (extraPython3PackagesFun ps)
|
++ (extraPython3PackagesFun ps)
|
||||||
++ (concatMap (f: f ps) pluginPython3Packages));
|
++ (concatMap (f: f ps) pluginPython3Packages));
|
||||||
|
|
||||||
|
binPath = makeBinPath (optionals withRuby [rubyEnv] ++ optionals withNodeJs [nodejs]);
|
||||||
|
|
||||||
in
|
in
|
||||||
stdenv.mkDerivation {
|
stdenv.mkDerivation {
|
||||||
name = "neovim-${stdenv.lib.getVersion neovim}";
|
name = "neovim-${stdenv.lib.getVersion neovim}";
|
||||||
|
@ -62,10 +67,12 @@ let
|
||||||
|
|
||||||
makeWrapper "$(readlink -v --canonicalize-existing "${bin}")" \
|
makeWrapper "$(readlink -v --canonicalize-existing "${bin}")" \
|
||||||
"$out/bin/nvim" --add-flags " \
|
"$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 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 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"}\" " \
|
--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) ''
|
+ optionalString (!stdenv.isDarwin) ''
|
||||||
|
|
Loading…
Reference in a new issue