Merge pull request #136315 from gpanders/neovim-lua-packages

neovim: allow extra Lua packages

authored by

Matthieu Coudron and committed by
GitHub
433d95ee eb21f8d4

+24
+2
pkgs/applications/editors/neovim/default.nix
··· 50 51 dontFixCmake = true; 52 53 buildInputs = [ 54 gperf 55 libtermkey
··· 50 51 dontFixCmake = true; 52 53 + inherit lua; 54 + 55 buildInputs = [ 56 gperf 57 libtermkey
+11
pkgs/applications/editors/neovim/tests.nix
··· 132 extraName = "-pathogen"; 133 configure.pathogen.pluginNames = [ "vim-nix" ]; 134 }; 135 })
··· 132 extraName = "-pathogen"; 133 configure.pathogen.pluginNames = [ "vim-nix" ]; 134 }; 135 + 136 + nvimWithLuaPackages = wrapNeovim2 "with-lua-packages" (makeNeovimConfig { 137 + extraLuaPackages = ps: [ps.mpack]; 138 + customRC = '' 139 + lua require("mpack") 140 + ''; 141 + }); 142 + 143 + nvim_with_lua_packages = runTest nvimWithLuaPackages '' 144 + ${nvimWithLuaPackages}/bin/nvim -i NONE --noplugin -es 145 + ''; 146 })
+11
pkgs/applications/editors/neovim/utils.nix
··· 28 , extraPython3Packages ? (_: [ ]) 29 , withNodeJs ? false 30 , withRuby ? true 31 32 # expects a list of plugin configuration 33 # expects { plugin=far-vim; config = "let g:far#source='rg'"; optional = false; } ··· 76 ++ (extraPython3Packages ps) 77 ++ (lib.concatMap (f: f ps) pluginPython3Packages)); 78 79 80 # Mapping a boolean argument to a key that tells us whether to add or not to 81 # add to nvim's 'embedded rc' this: ··· 110 "--set" "GEM_HOME" "${rubyEnv}/${rubyEnv.ruby.gemPath}" 111 ] ++ lib.optionals (binPath != "") [ 112 "--suffix" "PATH" ":" binPath 113 ]; 114 115 ··· 123 inherit neovimRcContent; 124 inherit manifestRc; 125 inherit python3Env; 126 inherit withNodeJs; 127 } // lib.optionalAttrs withRuby { 128 inherit rubyEnv; ··· 143 , extraPythonPackages ? (_: []) 144 /* the function you would have passed to python.withPackages */ 145 , withPython3 ? true, extraPython3Packages ? (_: []) 146 , withNodeJs ? false 147 , withRuby ? true 148 , vimAlias ? false ··· 159 res = makeNeovimConfig { 160 inherit withPython3; 161 extraPython3Packages = compatFun extraPython3Packages; 162 inherit withNodeJs withRuby viAlias vimAlias; 163 inherit configure; 164 inherit extraName;
··· 28 , extraPython3Packages ? (_: [ ]) 29 , withNodeJs ? false 30 , withRuby ? true 31 + /* the function you would have passed to lua.withPackages */ 32 + , extraLuaPackages ? (_: [ ]) 33 34 # expects a list of plugin configuration 35 # expects { plugin=far-vim; config = "let g:far#source='rg'"; optional = false; } ··· 78 ++ (extraPython3Packages ps) 79 ++ (lib.concatMap (f: f ps) pluginPython3Packages)); 80 81 + lua = neovim-unwrapped.lua; 82 + luaEnv = lua.withPackages(ps: extraLuaPackages ps); 83 84 # Mapping a boolean argument to a key that tells us whether to add or not to 85 # add to nvim's 'embedded rc' this: ··· 114 "--set" "GEM_HOME" "${rubyEnv}/${rubyEnv.ruby.gemPath}" 115 ] ++ lib.optionals (binPath != "") [ 116 "--suffix" "PATH" ":" binPath 117 + ] ++ lib.optionals (luaEnv != null) [ 118 + "--prefix" "LUA_PATH" ";" "${luaEnv}/share/lua/${lua.luaversion}/?.lua" 119 + "--prefix" "LUA_CPATH" ";" "${luaEnv}/lib/lua/${lua.luaversion}/?.so" 120 ]; 121 122 ··· 130 inherit neovimRcContent; 131 inherit manifestRc; 132 inherit python3Env; 133 + inherit luaEnv; 134 inherit withNodeJs; 135 } // lib.optionalAttrs withRuby { 136 inherit rubyEnv; ··· 151 , extraPythonPackages ? (_: []) 152 /* the function you would have passed to python.withPackages */ 153 , withPython3 ? true, extraPython3Packages ? (_: []) 154 + /* the function you would have passed to lua.withPackages */ 155 + , extraLuaPackages ? (_: []) 156 , withNodeJs ? false 157 , withRuby ? true 158 , vimAlias ? false ··· 169 res = makeNeovimConfig { 170 inherit withPython3; 171 extraPython3Packages = compatFun extraPython3Packages; 172 + inherit extraLuaPackages; 173 inherit withNodeJs withRuby viAlias vimAlias; 174 inherit configure; 175 inherit extraName;