From f7408d31489c6e19d165f15ca0a988618df9df65 Mon Sep 17 00:00:00 2001 From: Matthieu Coudron <886074+teto@users.noreply.github.com> Date: Mon, 10 Feb 2025 17:41:54 +0100 Subject: [PATCH] =?UTF-8?q?vimPlugins.rocks-nvim:=20add=20initLua=20for=20?= =?UTF-8?q?a=20working=20out=20of=20the=20box=20exper=E2=80=A6=20(#375083)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- .../editors/neovim/tests/default.nix | 12 ++++++++++++ .../editors/vim/plugins/overrides.nix | 18 +++++++++++++++++- 2 files changed, 29 insertions(+), 1 deletion(-) diff --git a/pkgs/applications/editors/neovim/tests/default.nix b/pkgs/applications/editors/neovim/tests/default.nix index c6579c9ad17b..14d9803ee2d9 100644 --- a/pkgs/applications/editors/neovim/tests/default.nix +++ b/pkgs/applications/editors/neovim/tests/default.nix @@ -103,6 +103,13 @@ let ${pkgs.perl}/bin/perl -pe "s|\Q$NIX_STORE\E/[a-z0-9]{32}-|$NIX_STORE/eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee-|g" < "$luarc" > "$luarcGeneric" '' + buildCommand); + nvim_with_rocks_nvim = ( + wrapNeovimUnstable neovim-unwrapped { + extraName = "with-rocks-nvim"; + wrapperArgs = "--set NVIM_APPNAME test-rocks-nvim"; + plugins = [ vimPlugins.rocks-nvim ]; + } + ); in pkgs.recurseIntoAttrs (rec { @@ -367,5 +374,10 @@ in ${nvim-with-luasnip}/bin/nvim -i NONE --cmd "lua require'jsregexp'" -e +quitall! ''; + inherit nvim_with_rocks_nvim; + rocks_install_plenary = runTest nvim_with_rocks_nvim '' + ${nvim_with_rocks_nvim}/bin/nvim -V3log.txt -i NONE +'Rocks install plenary.nvim' +quit! -e + ''; + inherit (vimPlugins) corePlugins; }) diff --git a/pkgs/applications/editors/vim/plugins/overrides.nix b/pkgs/applications/editors/vim/plugins/overrides.nix index d4ce6ebd97c9..27e72add1390 100644 --- a/pkgs/applications/editors/vim/plugins/overrides.nix +++ b/pkgs/applications/editors/vim/plugins/overrides.nix @@ -4019,7 +4019,6 @@ in "papis-nvim" "rest-nvim" "rocks-config-nvim" - "rocks-nvim" "rtp-nvim" "telescope-manix" "telescope-nvim" @@ -4032,3 +4031,20 @@ in in lib.genAttrs luarocksPackageNames toVimPackage ) +// { + + rocks-nvim = + (neovimUtils.buildNeovimPlugin { + luaAttr = luaPackages.rocks-nvim; + }).overrideAttrs + (oa: { + passthru = oa.passthru // { + initLua = '' + vim.g.rocks_nvim = { + luarocks_binary = "${neovim-unwrapped.lua.pkgs.luarocks_bootstrap}/bin/luarocks" + } + ''; + }; + + }); +}