nixos/navidrome: add openFirewall option

This adds an option to the navidrome module to open the configured TCP
port in the firewall.

authored by Nathan Henrie and committed by Bjørn Forsman 6c69d3c9 cd014bdb

+7
+7
nixos/modules/services/audio/navidrome.nix
··· 28 ''; 29 }; 30 31 }; 32 }; 33 34 config = mkIf cfg.enable { 35 systemd.services.navidrome = { 36 description = "Navidrome Media Server"; 37 after = [ "network.target" ];
··· 28 ''; 29 }; 30 31 + openFirewall = mkOption { 32 + type = types.bool; 33 + default = false; 34 + description = lib.mdDoc "Whether to open the TCP port in the firewall"; 35 + }; 36 }; 37 }; 38 39 config = mkIf cfg.enable { 40 + networking.firewall.allowedTCPPorts = mkIf cfg.openFirewall [cfg.settings.Port]; 41 + 42 systemd.services.navidrome = { 43 description = "Navidrome Media Server"; 44 after = [ "network.target" ];