diff options
author | Florian Klink <flokli@flokli.de> | 2020-05-04 11:47:45 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-04 11:47:45 +0200 |
commit | dd38a549f84b8618dd4ff874de240c6518f1f310 (patch) | |
tree | 2006eaa1055576ea0a7c5ded0df7dd442989bb1c /nixos | |
parent | 9b54c30474dbcdc61665bd3b39e3d00362d96be8 (diff) | |
parent | 96146a947678aaef6ba1ec5b8887cc79a70603ca (diff) | |
download | nixlib-dd38a549f84b8618dd4ff874de240c6518f1f310.tar nixlib-dd38a549f84b8618dd4ff874de240c6518f1f310.tar.gz nixlib-dd38a549f84b8618dd4ff874de240c6518f1f310.tar.bz2 nixlib-dd38a549f84b8618dd4ff874de240c6518f1f310.tar.lz nixlib-dd38a549f84b8618dd4ff874de240c6518f1f310.tar.xz nixlib-dd38a549f84b8618dd4ff874de240c6518f1f310.tar.zst nixlib-dd38a549f84b8618dd4ff874de240c6518f1f310.zip |
Merge pull request #86649 from mmilata/prosody-muc-extraconfig
nixos/prosody: add MUC extraConfig + fixes
Diffstat (limited to 'nixos')
-rw-r--r-- | nixos/modules/services/networking/prosody.nix | 13 | ||||
-rw-r--r-- | nixos/tests/xmpp/prosody-mysql.nix | 15 |
2 files changed, 24 insertions, 4 deletions
diff --git a/nixos/modules/services/networking/prosody.nix b/nixos/modules/services/networking/prosody.nix index 9825613d809f..cdd341c9fb62 100644 --- a/nixos/modules/services/networking/prosody.nix +++ b/nixos/modules/services/networking/prosody.nix @@ -382,6 +382,11 @@ let default = "en"; description = "Default room language."; }; + extraConfig = mkOption { + type = types.lines; + default = ""; + description = "Additional MUC specific configuration"; + }; }; }; @@ -792,6 +797,8 @@ in https_ports = ${toLua cfg.httpsPorts} + ${ cfg.extraConfig } + ${lib.concatMapStrings (muc: '' Component ${toLua muc.domain} "muc" modules_enabled = { "muc_mam"; ${optionalString muc.vcard_muc ''"vcard_muc";'' } } @@ -809,8 +816,8 @@ in muc_room_default_change_subject = ${toLua muc.roomDefaultChangeSubject} muc_room_default_history_length = ${toLua muc.roomDefaultHistoryLength} muc_room_default_language = ${toLua muc.roomDefaultLanguage} - - '') cfg.muc} + ${ muc.extraConfig } + '') cfg.muc} ${ lib.optionalString (cfg.uploadHttp != null) '' Component ${toLua cfg.uploadHttp.domain} "http_upload" @@ -820,8 +827,6 @@ in http_upload_path = ${toLua cfg.uploadHttp.httpUploadPath} ''} - ${ cfg.extraConfig } - ${ lib.concatStringsSep "\n" (lib.mapAttrsToList (n: v: '' VirtualHost "${v.domain}" enabled = ${boolToString v.enabled}; diff --git a/nixos/tests/xmpp/prosody-mysql.nix b/nixos/tests/xmpp/prosody-mysql.nix index 0507227021b2..9a00bcabf389 100644 --- a/nixos/tests/xmpp/prosody-mysql.nix +++ b/nixos/tests/xmpp/prosody-mysql.nix @@ -6,6 +6,11 @@ import ../make-test-python.nix { environment.systemPackages = [ (pkgs.callPackage ./xmpp-sendmessage.nix { connectTo = nodes.server.config.networking.primaryIPAddress; }) ]; + networking.extraHosts = '' + ${nodes.server.config.networking.primaryIPAddress} example.com + ${nodes.server.config.networking.primaryIPAddress} conference.example.com + ${nodes.server.config.networking.primaryIPAddress} uploads.example.com + ''; }; server = { config, pkgs, ... }: { nixpkgs.overlays = [ @@ -18,6 +23,8 @@ import ../make-test-python.nix { ]; networking.extraHosts = '' ${config.networking.primaryIPAddress} example.com + ${config.networking.primaryIPAddress} conference.example.com + ${config.networking.primaryIPAddress} uploads.example.com ''; networking.firewall.enable = false; services.prosody = { @@ -39,6 +46,14 @@ import ../make-test-python.nix { domain = "example.com"; enabled = true; }; + muc = [ + { + domain = "conference.example.com"; + } + ]; + uploadHttp = { + domain = "uploads.example.com"; + }; }; }; mysql = { config, pkgs, ... }: { |