Skip to content

Commit

Permalink
gmediarender: add openFirewall option
Browse files Browse the repository at this point in the history
This opens the necessary ports on the firewall if confgured.
  • Loading branch information
mdorman committed Mar 5, 2023
1 parent 9b96e87 commit 87df5e7
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions nixos/modules/services/audio/gmediarender.nix
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,14 @@ in
'';
};

openFirewall = mkOption {
type = types.bool;
default = false;
description = lib.mdDoc ''
Whether to automatically open the appropriate ports in the firewall. (1900 and whatever value is specified in port)
'';
};

package = mkPackageOptionMD pkgs "gmediarender" {
default = "gmrender-resurrect";
};
Expand Down Expand Up @@ -112,5 +120,7 @@ in
};
};
};
networking.firewall.allowedTCPPorts = optionals cfg.openFirewall (if cfg.port != null then [cfg.port] else [49494]);
networking.firewall.allowedUDPPorts = optionals cfg.openFirewall ([ 1900 ]);
};
}

0 comments on commit 87df5e7

Please sign in to comment.