From 3036333bb986b5542daa19bd9b67036d29ba2c65 Mon Sep 17 00:00:00 2001 From: Sergey Date: Mon, 1 Dec 2025 22:31:08 +0000 Subject: [PATCH] nixos/prosody: add muc_notifications module support --- nixos/modules/services/networking/prosody.nix | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/nixos/modules/services/networking/prosody.nix b/nixos/modules/services/networking/prosody.nix index a388ad670304..1df8686b1fe6 100644 --- a/nixos/modules/services/networking/prosody.nix +++ b/nixos/modules/services/networking/prosody.nix @@ -8,6 +8,13 @@ with lib; let cfg = config.services.prosody; + communityModulesToEnable = + let + componentSpecificModules = [ "muc_notifications" ]; + in + lib.concatMap ( + mod: lib.optional (!(lib.elem mod componentSpecificModules)) "${toLua mod};" + ) cfg.package.communityModules; sslOpts = _: { options = { @@ -546,7 +553,7 @@ let ${lib.concatStringsSep "\n " ( lib.mapAttrsToList (name: val: optionalString val "${toLua name};") cfg.modules )} - ${lib.concatStringsSep "\n" (map (x: "${toLua x};") cfg.package.communityModules)} + ${lib.concatStringsSep "\n" communityModulesToEnable} ${lib.concatStringsSep "\n" (map (x: "${toLua x};") cfg.extraModules)} }; @@ -577,7 +584,7 @@ let ${lib.concatMapStrings (muc: '' Component ${toLua muc.domain} "muc" - modules_enabled = {${optionalString cfg.modules.mam ''"muc_mam",''}${optionalString muc.allowners_muc ''"muc_allowners",''}${optionalString muc.moderation ''"muc_moderation",''} } + 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",''} } name = ${toLua muc.name} restrict_room_creation = ${toLua muc.restrictRoomCreation} max_history_messages = ${toLua muc.maxHistoryMessages}