nixos/navidrome: add openFirewall option

This adds an option to the navidrome module to open the configured TCP
port in the firewall.
This commit is contained in:
Nathan Henrie 2023-11-03 12:53:05 -06:00 committed by Bjørn Forsman
parent cd014bdb85
commit 6c69d3c9ca

View file

@ -28,10 +28,17 @@ in {
'';
};
openFirewall = mkOption {
type = types.bool;
default = false;
description = lib.mdDoc "Whether to open the TCP port in the firewall";
};
};
};
config = mkIf cfg.enable {
networking.firewall.allowedTCPPorts = mkIf cfg.openFirewall [cfg.settings.Port];
systemd.services.navidrome = {
description = "Navidrome Media Server";
after = [ "network.target" ];