prosody: improve module handling
This commit is contained in:
parent
88f06c5ce9
commit
0a80f2c0f4
@ -347,6 +347,11 @@ following incompatible changes:</para>
|
|||||||
<para>
|
<para>
|
||||||
The better-performing <literal>libevent</literal> backend is now enabled by default.
|
The better-performing <literal>libevent</literal> backend is now enabled by default.
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
|
<para>
|
||||||
|
<literal>withCommunityModules</literal> now passes through the modules to <option>services.prosody.extraModules</option>.
|
||||||
|
Use <literal>withOnlyInstalledCommunityModules</literal> for modules that should not be enabled directly, e.g <literal>lib_ldap</literal>.
|
||||||
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
|
|
||||||
</itemizedlist>
|
</itemizedlist>
|
||||||
|
@ -362,6 +362,12 @@ in
|
|||||||
description = "Enable custom modules";
|
description = "Enable custom modules";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
extraPluginPaths = mkOption {
|
||||||
|
type = types.listOf types.path;
|
||||||
|
default = [];
|
||||||
|
description = "Addtional path in which to look find plugins/modules";
|
||||||
|
};
|
||||||
|
|
||||||
virtualHosts = mkOption {
|
virtualHosts = mkOption {
|
||||||
|
|
||||||
description = "Define the virtual hosts";
|
description = "Define the virtual hosts";
|
||||||
@ -411,16 +417,18 @@ in
|
|||||||
|
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
|
|
||||||
environment.systemPackages = [ pkgs.prosody ];
|
environment.systemPackages = [ cfg.package ];
|
||||||
|
|
||||||
environment.etc."prosody/prosody.cfg.lua".text = ''
|
environment.etc."prosody/prosody.cfg.lua".text = ''
|
||||||
|
|
||||||
pidfile = "/var/lib/prosody/prosody.pid"
|
pidfile = "/var/lib/prosody/prosody.pid"
|
||||||
|
|
||||||
|
|
||||||
log = "*syslog"
|
log = "*syslog"
|
||||||
|
|
||||||
data_path = "/var/lib/prosody"
|
data_path = "/var/lib/prosody"
|
||||||
|
plugin_paths = {
|
||||||
|
${lib.concatStringsSep ", " (map (n: "\"${n}\"") cfg.extraPluginPaths) }
|
||||||
|
}
|
||||||
|
|
||||||
${ optionalString (cfg.ssl != null) (createSSLOptsStr cfg.ssl) }
|
${ optionalString (cfg.ssl != null) (createSSLOptsStr cfg.ssl) }
|
||||||
|
|
||||||
@ -434,7 +442,7 @@ in
|
|||||||
${ lib.concatStringsSep "\n\ \ " (lib.mapAttrsToList
|
${ lib.concatStringsSep "\n\ \ " (lib.mapAttrsToList
|
||||||
(name: val: optionalString val "${toLua name};")
|
(name: val: optionalString val "${toLua name};")
|
||||||
cfg.modules) }
|
cfg.modules) }
|
||||||
|
${ lib.concatStringsSep "\n" (map (x: "${toLua x};") cfg.package.communityModules)}
|
||||||
${ lib.concatStringsSep "\n" (map (x: "${toLua x};") cfg.extraModules)}
|
${ lib.concatStringsSep "\n" (map (x: "${toLua x};") cfg.extraModules)}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -4,6 +4,7 @@
|
|||||||
, withDBI ? true, luadbi ? null
|
, withDBI ? true, luadbi ? null
|
||||||
# use withExtraLibs to add additional dependencies of community modules
|
# use withExtraLibs to add additional dependencies of community modules
|
||||||
, withExtraLibs ? [ ]
|
, withExtraLibs ? [ ]
|
||||||
|
, withOnlyInstalledCommunityModules ? [ ]
|
||||||
, withCommunityModules ? [ ] }:
|
, withCommunityModules ? [ ] }:
|
||||||
|
|
||||||
assert withLibevent -> luaevent != null;
|
assert withLibevent -> luaevent != null;
|
||||||
@ -38,7 +39,8 @@ stdenv.mkDerivation rec {
|
|||||||
sha256 = "0nfx3lngcy88nd81gb7v4kh3nz1bzsm67bxgpd2lprk54diqcrz1";
|
sha256 = "0nfx3lngcy88nd81gb7v4kh3nz1bzsm67bxgpd2lprk54diqcrz1";
|
||||||
};
|
};
|
||||||
|
|
||||||
buildInputs = [ lua5 makeWrapper libidn openssl ];
|
buildInputs = [ lua5 makeWrapper libidn openssl ]
|
||||||
|
++ optional withDBI luadbi;
|
||||||
|
|
||||||
configureFlags = [
|
configureFlags = [
|
||||||
"--ostype=linux"
|
"--ostype=linux"
|
||||||
@ -49,7 +51,7 @@ stdenv.mkDerivation rec {
|
|||||||
postInstall = ''
|
postInstall = ''
|
||||||
${concatMapStringsSep "\n" (module: ''
|
${concatMapStringsSep "\n" (module: ''
|
||||||
cp -r $communityModules/mod_${module} $out/lib/prosody/modules/
|
cp -r $communityModules/mod_${module} $out/lib/prosody/modules/
|
||||||
'') withCommunityModules}
|
'') (withCommunityModules ++ withOnlyInstalledCommunityModules)}
|
||||||
wrapProgram $out/bin/prosody \
|
wrapProgram $out/bin/prosody \
|
||||||
--set LUA_PATH '${luaPath};' \
|
--set LUA_PATH '${luaPath};' \
|
||||||
--set LUA_CPATH '${luaCPath};'
|
--set LUA_CPATH '${luaCPath};'
|
||||||
@ -59,11 +61,13 @@ stdenv.mkDerivation rec {
|
|||||||
--set LUA_CPATH '${luaCPath};'
|
--set LUA_CPATH '${luaCPath};'
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
passthru.communityModules = withCommunityModules;
|
||||||
|
|
||||||
meta = {
|
meta = {
|
||||||
description = "Open-source XMPP application server written in Lua";
|
description = "Open-source XMPP application server written in Lua";
|
||||||
license = licenses.mit;
|
license = licenses.mit;
|
||||||
homepage = https://prosody.im;
|
homepage = https://prosody.im;
|
||||||
platforms = platforms.linux;
|
platforms = platforms.linux;
|
||||||
maintainers = [ ];
|
maintainers = with maintainers; [ fpletz globin ];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user