vimPlugins.rocks-nvim: add initLua for a working out of the box exper… (#375083)

vimPlugins.rocks-nvim: add initLua for a working out of the box experience

added a test as well. Using NVIM_APPNAME to run "neovim.tests.nvim_with_rocks_nvim" in a minimal sandbox.

authored by

Matthieu Coudron and committed by
GitHub
f7408d31 dffcaa4d

+29 -1
+12
pkgs/applications/editors/neovim/tests/default.nix
··· 103 103 ${pkgs.perl}/bin/perl -pe "s|\Q$NIX_STORE\E/[a-z0-9]{32}-|$NIX_STORE/eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee-|g" < "$luarc" > "$luarcGeneric" 104 104 '' + buildCommand); 105 105 106 + nvim_with_rocks_nvim = ( 107 + wrapNeovimUnstable neovim-unwrapped { 108 + extraName = "with-rocks-nvim"; 109 + wrapperArgs = "--set NVIM_APPNAME test-rocks-nvim"; 110 + plugins = [ vimPlugins.rocks-nvim ]; 111 + } 112 + ); 106 113 in 107 114 pkgs.recurseIntoAttrs (rec { 108 115 ··· 365 372 can_require_transitive_deps = 366 373 runTest nvim-with-luasnip '' 367 374 ${nvim-with-luasnip}/bin/nvim -i NONE --cmd "lua require'jsregexp'" -e +quitall! 375 + ''; 376 + 377 + inherit nvim_with_rocks_nvim; 378 + rocks_install_plenary = runTest nvim_with_rocks_nvim '' 379 + ${nvim_with_rocks_nvim}/bin/nvim -V3log.txt -i NONE +'Rocks install plenary.nvim' +quit! -e 368 380 ''; 369 381 370 382 inherit (vimPlugins) corePlugins;
+17 -1
pkgs/applications/editors/vim/plugins/overrides.nix
··· 4019 4019 "papis-nvim" 4020 4020 "rest-nvim" 4021 4021 "rocks-config-nvim" 4022 - "rocks-nvim" 4023 4022 "rtp-nvim" 4024 4023 "telescope-manix" 4025 4024 "telescope-nvim" ··· 4032 4031 in 4033 4032 lib.genAttrs luarocksPackageNames toVimPackage 4034 4033 ) 4034 + // { 4035 + 4036 + rocks-nvim = 4037 + (neovimUtils.buildNeovimPlugin { 4038 + luaAttr = luaPackages.rocks-nvim; 4039 + }).overrideAttrs 4040 + (oa: { 4041 + passthru = oa.passthru // { 4042 + initLua = '' 4043 + vim.g.rocks_nvim = { 4044 + luarocks_binary = "${neovim-unwrapped.lua.pkgs.luarocks_bootstrap}/bin/luarocks" 4045 + } 4046 + ''; 4047 + }; 4048 + 4049 + }); 4050 + }