Commit 6c69d3c9 authored by Nathan Henrie's avatar Nathan Henrie Committed by Bjørn Forsman
Browse files

nixos/navidrome: add openFirewall option

This adds an option to the navidrome module to open the configured TCP
port in the firewall.
parent cd014bdb
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -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" ];