diff options
author | Matt McHenry <github@matt.mchenryfamily.org> | 2016-12-18 21:59:06 -0500 |
---|---|---|
committer | Matt McHenry <github@matt.mchenryfamily.org> | 2016-12-24 15:36:52 -0500 |
commit | b64214f66f8f73d850e7ceef4d05dcaed50e5b59 (patch) | |
tree | 226123662228c3226f3b89d6c9d3b06c8af28923 /nixos/modules/services | |
parent | 1c50bdd928cec055d2ca842e2cf567aba2584efc (diff) | |
download | nixlib-b64214f66f8f73d850e7ceef4d05dcaed50e5b59.tar nixlib-b64214f66f8f73d850e7ceef4d05dcaed50e5b59.tar.gz nixlib-b64214f66f8f73d850e7ceef4d05dcaed50e5b59.tar.bz2 nixlib-b64214f66f8f73d850e7ceef4d05dcaed50e5b59.tar.lz nixlib-b64214f66f8f73d850e7ceef4d05dcaed50e5b59.tar.xz nixlib-b64214f66f8f73d850e7ceef4d05dcaed50e5b59.tar.zst nixlib-b64214f66f8f73d850e7ceef4d05dcaed50e5b59.zip |
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-
Diffstat (limited to 'nixos/modules/services')
-rw-r--r-- | nixos/modules/services/misc/plex.nix | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/nixos/modules/services/misc/plex.nix b/nixos/modules/services/misc/plex.nix index 92b352db416c..7c2322b7d892 100644 --- a/nixos/modules/services/misc/plex.nix +++ b/nixos/modules/services/misc/plex.nix @@ -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"; @@ -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; |