From d87a6a99f6dca40f54ec8e325c045afcb450066f Mon Sep 17 00:00:00 2001 From: Matthieu Coudron <886074+teto@users.noreply.github.com> Date: Fri, 7 Jul 2023 16:26:00 +0200 Subject: luarocks: can be embedded with lua.withPackages lua.withPackages only brings packages that have passthru.luaModule, which was not the case of luarocks (because it's built differently than other lua packages). We call toLuaModule on luarocks so that it is brought in a lua.withPackages call --- pkgs/development/lua-modules/lib.nix | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'pkgs/development/lua-modules/lib.nix') diff --git a/pkgs/development/lua-modules/lib.nix b/pkgs/development/lua-modules/lib.nix index bdf363fb47999..7c7ffcccf2639 100644 --- a/pkgs/development/lua-modules/lib.nix +++ b/pkgs/development/lua-modules/lib.nix @@ -89,7 +89,13 @@ rec { , rocksSubdir }: let rocksTrees = lib.imap0 - (i: dep: { name = "dep-${toString i}"; root = "${dep}"; rocks_dir = "${dep}/${dep.rocksSubdir}"; }) + (i: dep: { + name = "dep-${toString i}"; + root = "${dep}"; + # packages built by buildLuaPackage or luarocks doesn't contain rocksSubdir + # hence a default here + rocks_dir = if dep ? rocksSubdir then "${dep}/${dep.rocksSubdir}" else "${dep.pname}-${dep.version}-rocks"; + }) requiredLuaRocks; # Explicitly point luarocks to the relevant locations for multiple-output -- cgit 1.4.1