mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-16 23:03:40 +01:00
nixos/prosody: add MUC extraConfig, fix extraConfig order
Add extraConfig option for the muc submodule. Also move the global extraConfig before all components and virtualhosts, because the manual states: The configuration is divided into two parts. The first part is known as the "global" section. All settings here apply to the whole server, and are the default for all virtual hosts. The second half of the file is a series of VirtualHost and Component definitions. Settings under each VirtualHost or Component line apply only to that host. Before, if at least one muc was defined, or uploadHttp enabled, the global extraConfig would end up after "muc" or "http_upload" component making it apply to that component only and not globally.
This commit is contained in:
parent
5fda26c3d0
commit
ce0c39be0b
1 changed files with 9 additions and 4 deletions
|
@ -382,6 +382,11 @@ let
|
||||||
default = "en";
|
default = "en";
|
||||||
description = "Default room language.";
|
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}
|
https_ports = ${toLua cfg.httpsPorts}
|
||||||
|
|
||||||
|
${ cfg.extraConfig }
|
||||||
|
|
||||||
${lib.concatMapStrings (muc: ''
|
${lib.concatMapStrings (muc: ''
|
||||||
Component ${toLua muc.domain} "muc"
|
Component ${toLua muc.domain} "muc"
|
||||||
modules_enabled = { "muc_mam"; ${optionalString muc.vcard_muc ''"vcard_muc";'' } }
|
modules_enabled = { "muc_mam"; ${optionalString muc.vcard_muc ''"vcard_muc";'' } }
|
||||||
|
@ -809,7 +816,7 @@ in
|
||||||
muc_room_default_change_subject = ${toLua muc.roomDefaultChangeSubject}
|
muc_room_default_change_subject = ${toLua muc.roomDefaultChangeSubject}
|
||||||
muc_room_default_history_length = ${toLua muc.roomDefaultHistoryLength}
|
muc_room_default_history_length = ${toLua muc.roomDefaultHistoryLength}
|
||||||
muc_room_default_language = ${toLua muc.roomDefaultLanguage}
|
muc_room_default_language = ${toLua muc.roomDefaultLanguage}
|
||||||
|
${ muc.extraConfig }
|
||||||
'') cfg.muc}
|
'') cfg.muc}
|
||||||
|
|
||||||
${ lib.optionalString (cfg.uploadHttp != null) ''
|
${ lib.optionalString (cfg.uploadHttp != null) ''
|
||||||
|
@ -820,8 +827,6 @@ in
|
||||||
http_upload_path = ${toLua cfg.uploadHttp.httpUploadPath}
|
http_upload_path = ${toLua cfg.uploadHttp.httpUploadPath}
|
||||||
''}
|
''}
|
||||||
|
|
||||||
${ cfg.extraConfig }
|
|
||||||
|
|
||||||
${ lib.concatStringsSep "\n" (lib.mapAttrsToList (n: v: ''
|
${ lib.concatStringsSep "\n" (lib.mapAttrsToList (n: v: ''
|
||||||
VirtualHost "${v.domain}"
|
VirtualHost "${v.domain}"
|
||||||
enabled = ${boolToString v.enabled};
|
enabled = ${boolToString v.enabled};
|
||||||
|
|
Loading…
Reference in a new issue