From 91f33137366325a14f45a8ad4622c9c3814b43f6 Mon Sep 17 00:00:00 2001 From: Evgeny Kurnevsky Date: Sat, 6 Sep 2025 14:40:55 +0200 Subject: [PATCH] prosody: allow to specify http_external_url for http_file_share module --- nixos/modules/services/networking/prosody.nix | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/nixos/modules/services/networking/prosody.nix b/nixos/modules/services/networking/prosody.nix index ce55056710e2..cb35911ea3da 100644 --- a/nixos/modules/services/networking/prosody.nix +++ b/nixos/modules/services/networking/prosody.nix @@ -453,6 +453,11 @@ let or use a reverse proxy to handle the HTTP for that domain. ''; }; + http_external_url = mkOption { + type = types.nullOr types.str; + default = null; + description = "External URL in case Prosody sits behind a reverse proxy."; + }; size_limit = mkOption { type = types.int; default = 10 * 1024 * 1024; @@ -596,7 +601,17 @@ let ${lib.optionalString (cfg.httpFileShare.http_host != null) '' http_host = "${cfg.httpFileShare.http_host}" ''} - ${settingsToLua " http_file_share_" (cfg.httpFileShare // { domain = null; })} + ${lib.optionalString (cfg.httpFileShare.http_external_url != null) '' + http_external_url = "${cfg.httpFileShare.http_external_url}" + ''} + ${settingsToLua " http_file_share_" ( + cfg.httpFileShare + // { + domain = null; + http_host = null; + http_external_url = null; + } + )} ''} ${lib.concatStringsSep "\n" (