From 7a62c0bc957116b7fa61d469cf008038d34d5e2e Mon Sep 17 00:00:00 2001 From: Julien Moutinho Date: Tue, 12 Jan 2021 10:14:14 +0100 Subject: nixos/tor: fix openFirewall when ORPort isInt --- nixos/modules/services/security/tor.nix | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'nixos/modules/services/security/tor.nix') diff --git a/nixos/modules/services/security/tor.nix b/nixos/modules/services/security/tor.nix index 390dcfccfec..54c2c2dea23 100644 --- a/nixos/modules/services/security/tor.nix +++ b/nixos/modules/services/security/tor.nix @@ -909,8 +909,11 @@ in networking.firewall = mkIf cfg.openFirewall { allowedTCPPorts = - concatMap (o: optional (isInt o && o > 0 || o ? "port" && isInt o.port && o.port > 0) o.port) - (flatten [ + concatMap (o: + if isInt o && o > 0 then [o] + else if o ? "port" && isInt o.port && o.port > 0 then [o.port] + else [] + ) (flatten [ cfg.settings.ORPort cfg.settings.DirPort ]); -- cgit 1.4.1