Unverified Commit f7408d31 authored by Matthieu Coudron's avatar Matthieu Coudron Committed by GitHub
Browse files

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.
parent dffcaa4d
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -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;
})
+17 −1
Original line number Diff line number Diff line
@@ -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"
              }
          '';
        };

      });
}