generateLuarocksConfig: dont generate rocks_subdir by default

Goal is to make generateLuarocksConfig appropriate in more scenarios, in my case, to generate rocks.nvim luarocks config

We override the luarocks default for rocks_subdir to avoid conflicts when creating lua environments but it is not appropriate for other scenarios
so let's not default to it in the "lib" function.
This commit is contained in:
Matthieu C. 2024-07-05 13:38:46 +02:00 committed by Matthieu Coudron
parent 520ba7d7b1
commit 29cc0b4a6b
2 changed files with 4 additions and 5 deletions

View File

@ -134,12 +134,15 @@ let
externalDeps = lib.unique (self.externalDeps ++ externalDepsGenerated);
local_cache = "";
# To prevent collisions when creating environments, we install the rock
# files into per-package subdirectories
rocks_subdir = self.rocksSubdir;
# Filter out the lua derivation itself from the Lua module dependency
# closure, as it doesn't have a rock tree :)
# luaLib.hasLuaModule
requiredLuaRocks = lib.filter luaLib.hasLuaModule
(lua.pkgs.requiredLuaModules (self.nativeBuildInputs ++ self.propagatedBuildInputs));
inherit (self) rocksSubdir;
};
luarocksConfig' = lib.recursiveUpdate luarocksConfig

View File

@ -93,7 +93,6 @@ rec {
externalDeps ? []
# a list of lua derivations
, requiredLuaRocks ? []
, rocksSubdir ? "rocks-subdir"
, ...
}@args: let
rocksTrees = lib.imap0
@ -125,9 +124,6 @@ rec {
generatedConfig = ({
# To prevent collisions when creating environments, we install the rock
# files into per-package subdirectories
rocks_subdir = rocksSubdir;
# 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.