Skip to content

Commit

Permalink
vimPlugins.rocks-nvim: add initLua for a working out of the box exper… (
Browse files Browse the repository at this point in the history
NixOS#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.
  • Loading branch information
teto authored Feb 10, 2025
1 parent dffcaa4 commit f7408d3
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 1 deletion.
12 changes: 12 additions & 0 deletions pkgs/applications/editors/neovim/tests/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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 {

Expand Down Expand Up @@ -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;
})
18 changes: 17 additions & 1 deletion pkgs/applications/editors/vim/plugins/overrides.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4019,7 +4019,6 @@ in
"papis-nvim"
"rest-nvim"
"rocks-config-nvim"
"rocks-nvim"
"rtp-nvim"
"telescope-manix"
"telescope-nvim"
Expand All @@ -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"
}
'';
};

});
}

0 comments on commit f7408d3

Please sign in to comment.