Skip to content

Commit 2ddefc1

Browse files
nixos/prosody: add muc_notifications module support (#434574)
2 parents 940ffc9 + 3036333 commit 2ddefc1

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

nixos/modules/services/networking/prosody.nix

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,13 @@
88
with lib;
99
let
1010
cfg = config.services.prosody;
11+
communityModulesToEnable =
12+
let
13+
componentSpecificModules = [ "muc_notifications" ];
14+
in
15+
lib.concatMap (
16+
mod: lib.optional (!(lib.elem mod componentSpecificModules)) "${toLua mod};"
17+
) cfg.package.communityModules;
1118

1219
sslOpts = _: {
1320
options = {
@@ -546,7 +553,7 @@ let
546553
${lib.concatStringsSep "\n " (
547554
lib.mapAttrsToList (name: val: optionalString val "${toLua name};") cfg.modules
548555
)}
549-
${lib.concatStringsSep "\n" (map (x: "${toLua x};") cfg.package.communityModules)}
556+
${lib.concatStringsSep "\n" communityModulesToEnable}
550557
${lib.concatStringsSep "\n" (map (x: "${toLua x};") cfg.extraModules)}
551558
};
552559
@@ -577,7 +584,7 @@ let
577584
578585
${lib.concatMapStrings (muc: ''
579586
Component ${toLua muc.domain} "muc"
580-
modules_enabled = {${optionalString cfg.modules.mam ''"muc_mam",''}${optionalString muc.allowners_muc ''"muc_allowners",''}${optionalString muc.moderation ''"muc_moderation",''} }
587+
modules_enabled = {${optionalString cfg.modules.mam ''"muc_mam",''}${optionalString muc.allowners_muc ''"muc_allowners",''}${optionalString muc.moderation ''"muc_moderation",''}${optionalString (lib.elem "muc_notifications" cfg.package.communityModules) ''"muc_notifications",''} }
581588
name = ${toLua muc.name}
582589
restrict_room_creation = ${toLua muc.restrictRoomCreation}
583590
max_history_messages = ${toLua muc.maxHistoryMessages}

0 commit comments

Comments
 (0)