Commit Graph

6 Commits

Author SHA1 Message Date
Gaétan Lepage
63e129f793
buildNeovimPlugin: set version accordingly to the manual guidelines (#289008)
https://github.com/NixOS/nixpkgs/blob/master/pkgs/README.md#package-naming
2024-02-25 18:15:04 +01:00
Matthieu Coudron
000b7bfd47
buildLuarocksPackage: ability to self reference extraConfig (#288253)
makes overrideAttrs for lua packages even more powerful.
As a consequence, it simplifies the implementation of buildNeovimPlugin.
2024-02-12 18:11:24 +01:00
Matthieu Coudron
bd6def34e2
neovimUtils.buildNeovimPlugin: use version from derivation if missing (#288251)
Trying to use:
`plugin = pkgs.neovimUtils.buildNeovimPlugin { luaAttr = "rocks-nvim"; };`

fails with:

```
error: attribute 'version' missing

at /nix/store/0ww4wsg5q5hmnzv06a0k1q32jc49y7gi-source/pkgs/applications/editors/neovim/build-neovim-plugin.nix:28:19:

    27|         })).overrideAttrs (drv: {
    28|         version = attrs.version;
	|                   ^
    29|         rockspecVersion = drv.rockspecVersion;
```

This PR fixes it.
2024-02-12 11:15:54 +01:00
Matthieu Coudron
2acce7dfdc vimPlugins: make usage of luaPackages less confusing
right now the src is ignored in:

```
  lush-nvim = buildNeovimPlugin {
    pname = "lush.nvim";
    version = "2022-08-09";
    src = fetchFromGitHub {
      owner = "rktjmp";
      repo = "lush.nvim";
      rev = "6b9f399245de7bea8dac2c3bf91096ffdedfcbb7";
      sha256 = "0rb77rwmbm438bmbjfk5hwrrcn5sihsa1413bdpc27rw3rrn8v8z";
    };
    meta.homepage = "https://github.com/rktjmp/lush.nvim/";
  };
```

which is very confusing. With this PR, we correctly override the src and
the version of the package. We introduce a rockspecVersion attribute of
lua package to be able to still find the rockspec when the
"version" field needs to be different than "rockspecVersion".
2022-10-13 19:57:35 +02:00
Artturin
ec35f6341b lua-packages: try splicing 2022-08-26 20:04:02 +03:00
Matthieu Coudron
ce505a3984
vimPlugins: use lua derivation if it exists (#178180)
Neovim plugins are now more often than not written in lua.
One advantage of the lua ecosystem over vim's is the existence of
luarocks and the rockspec format, which allows to specify a package
dependencies formally.
I would like more neovim plugins to have a formal description,
"rockspec" being the current candidate.
This MR allows to use nix lua packages as neovim plugins, so as to enjoy
every benefit that rockspecs bring:
- dependdency discovery
- ability to run test suite
- luarocks versioning
- rockspec metadata

the vim update.py script will check if an attribute with the vim plugin
pname exists in lua51Packages. If it does, it uses
buildNeovimPluginFrom2Nix on it, which modifies the luarocks config to
do an almost flat install (luarocks will install the package in the lua
folder instead of share/5.1/lua etc).
It also calls toVimPlugin on it to get all the vim plugin niceties.

The list of packages that could benefit from this is available at
https://luarocks.org/labels/neovim
but I hope it grows.
2022-06-19 14:18:16 +02:00