From 709eb8ebaf385269866963928e5b97c8ed68f408 Mon Sep 17 00:00:00 2001 From: Pol Dellaiera Date: Tue, 4 Jun 2024 21:05:18 +0200 Subject: [PATCH] nixos/open-webui: add `openFirewall` option --- nixos/modules/services/misc/open-webui.nix | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/nixos/modules/services/misc/open-webui.nix b/nixos/modules/services/misc/open-webui.nix index de61ff80e922..47d1b4623a39 100644 --- a/nixos/modules/services/misc/open-webui.nix +++ b/nixos/modules/services/misc/open-webui.nix @@ -45,6 +45,15 @@ in ''; description = "Extra environment variables for open-webui"; }; + + openFirewall = lib.mkOption { + type = types.bool; + default = false; + description = '' + Whether to open the firewall for Open-WebUI. + This adds `services.open-webui.port` to `networking.firewall.allowedTCPPorts`. + ''; + }; }; }; @@ -88,6 +97,8 @@ in UMask = "0077"; }; }; + + networking.firewall = lib.mkIf cfg.openFirewall { allowedTCPPorts = [ cfg.port ]; }; }; meta.maintainers = with lib.maintainers; [ shivaraj-bh ];