* buildLuarocksPackage: save luarocks config as derivation
while debugging luarocks packages, it's exhausting to have to build
them, look at what random folder they've been built to finally look for
their config.
With this you can run
nix build lua51Packages.plenary-nvim.configFile -f .
and infer what luarocks will do.
* Update pkgs/development/interpreters/lua-5/build-luarocks-package.nix
Co-authored-by: Marc Jakobi <mrcjkb89@outlook.com>
---------
Co-authored-by: Marc Jakobi <mrcjkb89@outlook.com>
Deeply-curried functions are pretty error-prone in untyped languages
like Nix. This is a particularly bad case because
`top-level/splice.nix` *also* declares a makeScopeWithSplicing, but
it takes *two fewer arguments*.
Let's switch to attrset-passing form, to provide some minimal level
of sanity-checking.
buildLuaPackage accesses lua.pkgs.luarocks, which became unspliced
at some point. Let's use callPackage to get it, so we can be sure
it will be spliced.
While searching for something different I wondered why there is a
trivial-builders.nix file next to the trivial-builders directory where
only tests live. Lets fix that.
it makes overriding easier, instead of having to know internals to
decide which of `sqlite = prev.luaLib.overrideLuarocks prev.sqlite (drv: {` or
`sqlite = prev.sqlite.overrideAttrs (drv: {` just use the latter
hopefully makes the output of nixpkgs-review more sensible.
Lua package sets are different and it makes more sense than for other
languages for packages to not be supported in specific package sets.
Test with:
nix-build -A lua.tests pass
Tests are very limited for now, goal is mostly to put the infra into
place and enrich the tests when dealing with lua issues.
add luaPath/luaCpath as passthrough
makes it easier to generate LUA_PATH/LUA_CPATH
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".