Merge pull request #159366 from arcnmx/prosody-fixes

This commit is contained in:
Franz Pletz
2022-02-15 14:16:55 +01:00
committed by GitHub
2 changed files with 12 additions and 6 deletions
+11 -6
View File
@@ -5,6 +5,7 @@
, withDBI ? true
# use withExtraLibs to add additional dependencies of community modules
, withExtraLibs ? [ ]
, withExtraLuaPackages ? _: [ ]
, withOnlyInstalledCommunityModules ? [ ]
, withCommunityModules ? [ ] }:
@@ -17,6 +18,7 @@ let
]
++ lib.optional withLibevent p.luaevent
++ lib.optional withDBI p.luadbi
++ withExtraLuaPackages p
);
in
stdenv.mkDerivation rec {
@@ -63,23 +65,26 @@ stdenv.mkDerivation rec {
make -C tools/migration
'';
luaEnvPath = lua.pkgs.lib.genLuaPathAbsStr luaEnv;
luaEnvCPath = lua.pkgs.lib.genLuaCPathAbsStr luaEnv;
# the wrapping should go away once lua hook is fixed
postInstall = ''
${concatMapStringsSep "\n" (module: ''
cp -r $communityModules/mod_${module} $out/lib/prosody/modules/
'') (lib.lists.unique(nixosModuleDeps ++ withCommunityModules ++ withOnlyInstalledCommunityModules))}
wrapProgram $out/bin/prosody \
--prefix LUA_PATH ';' "$LUA_PATH" \
--prefix LUA_CPATH ';' "$LUA_CPATH"
--set LUA_PATH "$luaEnvPath" \
--set LUA_CPATH "$luaEnvCPath"
wrapProgram $out/bin/prosodyctl \
--add-flags '--config "/etc/prosody/prosody.cfg.lua"' \
--prefix LUA_PATH ';' "$LUA_PATH" \
--prefix LUA_CPATH ';' "$LUA_CPATH"
--set LUA_PATH "$luaEnvPath" \
--set LUA_CPATH "$luaEnvCPath"
make -C tools/migration install
wrapProgram $out/bin/prosody-migrator \
--prefix LUA_PATH ';' "$LUA_PATH" \
--prefix LUA_CPATH ';' "$LUA_CPATH"
--set LUA_PATH "$luaEnvPath" \
--set LUA_CPATH "$luaEnvCPath"
'';
passthru = {
+1
View File
@@ -21056,6 +21056,7 @@ with pkgs;
# _compat can probably be removed on next minor version after 0.10.0
lua = lua5_2_compat;
withExtraLibs = [];
withExtraLuaPackages = _: [];
};
prosody-filer = callPackage ../servers/xmpp/prosody-filer { };