nixos/LANraragi: Add `openFirewall` option (#421882)

authored by Norbert Melzer and committed by GitHub c623ad67 ef92e214

+8
+8
nixos/modules/services/web-apps/lanraragi.nix
··· 22 22 description = "Port for LANraragi's web interface."; 23 23 }; 24 24 25 + openFirewall = lib.mkEnableOption "" // { 26 + description = "Open ports in the firewall for the Radarr web interface."; 27 + }; 28 + 25 29 passwordFile = lib.mkOption { 26 30 type = lib.types.nullOr lib.types.path; 27 31 default = null; ··· 102 106 HSET LRR_CONFIG password $(${cfg.package}/bin/helpers/lrr-make-password-hash $(head -n1 ${cfg.passwordFile})) 103 107 EOF 104 108 ''; 109 + }; 110 + 111 + networking.firewall = lib.mkIf cfg.openFirewall { 112 + allowedTCPPorts = [ cfg.port ]; 105 113 }; 106 114 }; 107 115 }