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