Skip to content

Commit

Permalink
Merge pull request #21395 from jerith666/plex-firewall
Browse files Browse the repository at this point in the history
plex: add config option to open recommended network ports
  • Loading branch information
Mic92 committed Dec 24, 2016
2 parents 481569e + b64214f commit f4e58c2
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions nixos/modules/services/misc/plex.nix
Expand Up @@ -19,6 +19,14 @@ in
description = "The directory where Plex stores its data files.";
};

openFirewall = mkOption {
type = types.bool;
default = false;
description = ''
Open ports in the firewall for the media server
'';
};

user = mkOption {
type = types.str;
default = "plex";
Expand Down Expand Up @@ -141,6 +149,11 @@ in
};
};

networking.firewall = mkIf cfg.openFirewall {
allowedTCPPorts = [ 32400 3005 8324 32469 ];
allowedUDPPorts = [ 1900 5353 32410 32412 32413 32414 ];
};

users.extraUsers = mkIf (cfg.user == "plex") {
plex = {
group = cfg.group;
Expand Down

0 comments on commit f4e58c2

Please sign in to comment.