From dfa4ce2923eb6925ec9688be7364a7a4452d94f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sandro=20J=C3=A4ckel?= Date: Fri, 1 Aug 2025 04:35:37 +0200 Subject: [PATCH] nixos/prosody: add support for httpFileShare.http_host --- nixos/modules/services/networking/prosody.nix | 25 +++++++++++++++---- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/nixos/modules/services/networking/prosody.nix b/nixos/modules/services/networking/prosody.nix index b097843c1c9d..1cb047c9b125 100644 --- a/nixos/modules/services/networking/prosody.nix +++ b/nixos/modules/services/networking/prosody.nix @@ -440,6 +440,14 @@ let type = with types; nullOr str; description = "Domain name for a http_file_share service."; }; + http_host = mkOption { + type = types.nullOr types.str; + default = null; + description = '' + To avoid an additional DNS record and certificate, you may set this option to your primary domain (e.g. "example.com") + or use a reverse proxy to handle the HTTP for that domain. + ''; + }; size_limit = mkOption { type = types.int; default = 10 * 1024 * 1024; @@ -577,11 +585,18 @@ let ${muc.extraConfig} '') cfg.muc} - ${lib.optionalString (cfg.httpFileShare != null) '' - Component ${toLua cfg.httpFileShare.domain} "http_file_share" - modules_disabled = { "s2s" } - ${settingsToLua " http_file_share_" (cfg.httpFileShare // { domain = null; })} - ''} + ${ + lib.optionalString (cfg.httpFileShare != null) '' + Component ${toLua cfg.httpFileShare.domain} "http_file_share" + modules_disabled = { "s2s" } + '' + + lib.optionalString (cfg.httpFileShare.http_host != null) '' + http_host = "${cfg.httpFileShare.http_host}" + '' + + '' + ${settingsToLua " http_file_share_" (cfg.httpFileShare // { domain = null; })} + '' + } ${lib.concatStringsSep "\n" ( lib.mapAttrsToList (n: v: ''