Plex: Difference between revisions
m Category:Applications |
Reorganize Plex clients |
||
(4 intermediate revisions by 3 users not shown) | |||
Line 3: | Line 3: | ||
== Basic setup == | == Basic setup == | ||
Plex is | Plex is packaged in Nix. All you need is to edit your <code>configuration.nix</code>. A simple configuration looks like: | ||
<syntaxhighlight lang="nix"> | <syntaxhighlight lang="nix"> | ||
Line 16: | Line 16: | ||
Of course there's some more [https://search.nixos.org/options?query=plex options] that you can customize. | Of course there's some more [https://search.nixos.org/options?query=plex options] that you can customize. | ||
If your Plex media server is behind a router, you'll need to forward | If your Plex media server is behind a router, you'll need to forward TCP port <code>32400</code> to your Plex media server. | ||
Access Plex media server by browsing to <code>http://lan_ip:32400/web</code> | Access Plex media server by browsing to <code>http://lan_ip:32400/web</code> | ||
Line 22: | Line 22: | ||
=== Allow Plex to read external drives === | === Allow Plex to read external drives === | ||
You might encounter permission issues when you try to access external drives if you haven't configured anything else with the server yet. If you haven't explicitly set up a mounting configuration for your drives and instead have your desktop environment (e.g. GNOME or KDE) automatically mount it when you try accessing it via their file explorers, Plex won't be able to access the drive. This is because the desktop environment mounts it to your user, while Plex | You might encounter permission issues when you try to access external drives if you haven't configured anything else with the server yet. If you haven't explicitly set up a mounting configuration for your drives and instead have your desktop environment (e.g. GNOME or KDE) automatically mount it when you try accessing it via their file explorers, Plex won't be able to access the drive. This is because the desktop environment mounts it to your user, while Plex runs by default as the "plex" user. | ||
The easiest way to allow Plex to see these external drives | The easiest way to allow Plex to see these external drives is to change the Plex service's user . Here is an example: | ||
<syntaxhighlight lang="nix"> | <syntaxhighlight lang="nix"> | ||
services.plex = { | services.plex = { | ||
Line 38: | Line 38: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
The alternative to this is to explicitly mount the drives via [[Filesystems]] | The alternative to this is to explicitly mount the drives via [[Filesystems]]. This takes more effort to set up and requires every new drive you want plex to see to be explicitly declared, but allows more control in what Plex is allowed to see. | ||
== | == Clients == | ||
Plex Media Player | === Plex Media Player === | ||
[https://www.plex.tv/blog/plex-media-player-now-ambidextrous-free-kodi-said/ Plex Media Player] is Plex's media client, packaged in Nix as plex-media-player. | |||
=== Plex Desktop === | |||
Alternatively, a more newer and modern Plex client called Plex Desktop is packaged in Nix as plex-desktop. | |||
< | To be able to sign in in Plex Desktop, you may need to set <code>xdg.portal.xdgOpenUsePortal = true;</code> in your NixOS configuration. [https://github.com/NixOS/nixpkgs/issues/341968 See this issue]. | ||
=== Plexamp === | |||
Plex also provide Plexamp for music. It's packaged in Nix but (as of August 2024) only for x86_64. | |||
== SSL | == SSL access via Nginx reverse proxy == | ||
Because of several redirects within Plex media server it's not easy to make it accessible through SSL. | Because of several redirects within Plex media server it's not easy to make it accessible through SSL. The browser can complain, even if you have configured proper SSL certificates in your Plex setup. | ||
Fortunately [https://www.nginx.com/ Nginx] can be used as a reverse proxy server to access Plex media server. Most of the configuration below comes from [https://forums.plex.tv/t/how-to-setup-nginx-as-a-reverse-proxy-for-plex/212702/2 kopfpilot] on the Plex forum. | Fortunately [https://www.nginx.com/ Nginx] can be used as a reverse proxy server to access Plex media server. Most of the configuration below comes from [https://forums.plex.tv/t/how-to-setup-nginx-as-a-reverse-proxy-for-plex/212702/2 kopfpilot] on the Plex forum. |