From 9bf032ab9db6810d601053b9cda32f8bdd0a5eb1 Mon Sep 17 00:00:00 2001 From: Matthieu Coudron <886074+teto@users.noreply.github.com> Date: Tue, 22 Oct 2024 21:52:44 +0200 Subject: [PATCH] neovim: fix withNodeJs regression (#350345) neovim: fix regression about nodeJs / withRuby in the last neovim refactor, there was a regression regarding withNodeJs / withRuby handling, particulary not adding nodejs anymore to the PATH fix https://github.com/NixOS/nixpkgs/issues/349496 --- pkgs/applications/editors/neovim/wrapper.nix | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/pkgs/applications/editors/neovim/wrapper.nix b/pkgs/applications/editors/neovim/wrapper.nix index 60049e184ade..0913fa0a330f 100644 --- a/pkgs/applications/editors/neovim/wrapper.nix +++ b/pkgs/applications/editors/neovim/wrapper.nix @@ -107,7 +107,10 @@ let wrapperArgsStr = if lib.isString wrapperArgs then wrapperArgs else lib.escapeShellArgs wrapperArgs; - generatedWrapperArgs = + generatedWrapperArgs = let + binPath = lib.makeBinPath (lib.optional finalAttrs.withRuby rubyEnv ++ lib.optional finalAttrs.withNodeJs nodejs); + in + # vim accepts a limited number of commands so we join them all [ "--add-flags" ''--cmd "lua ${providerLuaRc}"'' @@ -116,10 +119,15 @@ let "--add-flags" ''--cmd "set packpath^=${finalPackdir}"'' "--add-flags" ''--cmd "set rtp^=${finalPackdir}"'' ] + ++ lib.optionals finalAttrs.withRuby [ + "--set" "GEM_HOME" "${rubyEnv}/${rubyEnv.ruby.gemPath}" + ] ++ lib.optionals (binPath != "") [ + "--suffix" "PATH" ":" binPath + ] ; providerLuaRc = neovimUtils.generateProviderRc { - inherit withPython3 withNodeJs withPerl; + inherit (finalAttrs) withPython3 withNodeJs withPerl; withRuby = rubyEnv != null; };