diff options
author | Jörg Thalheim <joerg@higgsboson.tk> | 2016-12-24 23:31:04 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-12-24 23:31:04 +0100 |
commit | f4e58c2eb265688ab0fd450673ede524561a23c7 (patch) | |
tree | dab2c930e14c18697ad2c1c5c7f37743bcc5b516 /nixos/modules/services | |
parent | 481569e58066bd440cfc03360be1959e6af9f70a (diff) | |
parent | b64214f66f8f73d850e7ceef4d05dcaed50e5b59 (diff) | |
download | nixlib-f4e58c2eb265688ab0fd450673ede524561a23c7.tar nixlib-f4e58c2eb265688ab0fd450673ede524561a23c7.tar.gz nixlib-f4e58c2eb265688ab0fd450673ede524561a23c7.tar.bz2 nixlib-f4e58c2eb265688ab0fd450673ede524561a23c7.tar.lz nixlib-f4e58c2eb265688ab0fd450673ede524561a23c7.tar.xz nixlib-f4e58c2eb265688ab0fd450673ede524561a23c7.tar.zst nixlib-f4e58c2eb265688ab0fd450673ede524561a23c7.zip |
Merge pull request #21395 from jerith666/plex-firewall
plex: add config option to open recommended network ports
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 48d3c05785ce..f6bf2dee9865 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; |