lua.lib: small fix

to avoid the error 'cfg.root_dir is null' see https://github.com/luarocks/luarocks/issues/1161 for details
This commit is contained in:
Matthieu Coudron 2022-03-29 03:48:20 +02:00
parent 2e5732b320
commit 0986a70be6

View File

@ -82,6 +82,8 @@ rec {
*/
generateLuarocksConfig = {
externalDeps
# a list of lua derivations
, requiredLuaRocks
, extraVariables ? {}
, rocksSubdir
@ -113,9 +115,10 @@ rec {
-- To prevent collisions when creating environments, we install the rock
-- files into per-package subdirectories
rocks_subdir = '${rocksSubdir}'
-- Then we need to tell luarocks where to find the rock files per
-- dependency
-- first tree is the default target where new rocks are installed,
-- any other trees in the list are treated as additional sources of installed rocks for matching dependencies.
rocks_trees = {
{name = "current", root = '${placeholder "out"}', rocks_dir = "current" },
${lib.concatStringsSep "\n, " rocksTrees}
}
'' + lib.optionalString lua.pkgs.isLuaJIT ''