mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-07-13 21:50:33 +03:00
plex: add config option to open recommended network ports
as prescribed at https://support.plex.tv/hc/en-us/articles/201543147-What-network-ports-do-I-need-to-allow-through-my-firewall-
This commit is contained in:
parent
1c50bdd928
commit
b64214f66f
1 changed files with 13 additions and 0 deletions
|
@ -19,6 +19,14 @@ in
|
||||||
description = "The directory where Plex stores its data files.";
|
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 {
|
user = mkOption {
|
||||||
type = types.str;
|
type = types.str;
|
||||||
default = "plex";
|
default = "plex";
|
||||||
|
@ -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") {
|
users.extraUsers = mkIf (cfg.user == "plex") {
|
||||||
plex = {
|
plex = {
|
||||||
group = cfg.group;
|
group = cfg.group;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue