Jellyfin: Difference between revisions

imported>Punkeel
m (fix "services.Jellyfin.enable = true;" (case))
imported>Jmarmstrong1207
(Add external drive configuration section)
Line 7: Line 7:
<syntaxHighlight lang=nix>
<syntaxHighlight lang=nix>
{
{
  services.jellyfin.enable = true;
   environment.systemPackages = [
   environment.systemPackages = [
     pkgs.jellyfin
     pkgs.jellyfin
Line 15: Line 16:
</syntaxHighlight>
</syntaxHighlight>


You'll also need to enable Jellyfin, e.g.
If you want more advanced configuration, use something like what's shown below and [https://search.nixos.org/options?query=jellyfin see the docs for more configuration options]
 
<code>services.jellyfin.enable = true;</code>
 
Or for more advanced configuration use something like what's shown below and [https://search.nixos.org/options?query=jellyfin see the docs for more configuration options]


<syntaxHighlight lang=nix>
<syntaxHighlight lang=nix>
Line 43: Line 40:
* Go to http://localhost:8096 if your setting this up on your primary computer or want to test your build locally.  
* Go to http://localhost:8096 if your setting this up on your primary computer or want to test your build locally.  
* If you're logging into a remote server, replace localhost with the ip address of the server.
* If you're logging into a remote server, replace localhost with the ip address of the server.
=== Allow Jellyfin 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, Jellyfin won't be able to access the drive. This is because the desktop environment mounts it to your user, while Jellyfin uses by default the "jellyfin" user.
The easiest way to allow it to see these external drives mounted is to change the service's user . Here is an example:
<syntaxhighlight lang="nix">
  services.jellyfin = {
    enable = true;
    openFirewall = true;
    user="yourusername";
  };
</syntaxhighlight>
If you have changed the user option after you have already installed Jellyfin, you have to change the permissions of the folder /var/lib/jellyfin via chown to the user you set it to by doing this:
<syntaxhighlight lang="nix">
  sudo chown -R /var/lib/jellyfin
</syntaxhighlight>
The alternative to this is to explicitly mount the drives via [https://nixos.wiki/wiki/Filesystems Filesystems], but 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.


== Hardware Transcoding ==
== Hardware Transcoding ==