summaryrefslogtreecommitdiffstats
path: root/usecases/server/jellyfin.nix
blob: 287566813e69a5ebc46de12dd3e872af6c4be53d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
inputs:

{ config, lib, pkgs, ... }:

{
  imports = [
    (inputs.nixpkgs-unstable.outPath + "/nixos/modules/services/misc/jellyfin.nix")
  ];

  disabledModules = [ "services/misc/jellyfin.nix" ];

  options = with lib; {
    services.jellyfin.allowedPaths = mkOption {
      type = with types; listOf str;
      description = ''
        A list of paths that Jellyfin is allowed to read
      '';
    };
  };

  config = {
    services.jellyfin = {
      enable = true;
      package = pkgs.unstable.jellyfin;
    };

    networking.firewall.interfaces.${config.topology.mainVpn.interfaceName}.allowedTCPPorts = [
      8096
    ];

    systemd.services.jellyfin.serviceConfig = {
      # TODO: remove when #108224 is merged

      # Allows access to drm devices for transcoding with hardware acceleration
      SupplementaryGroups = [ "video" "render" ];
      # char-drm Allows ffmpeg to transcode with hardware acceleration
      DeviceAllow = lib.mkForce [ "char-drm rw" ];

      PrivateDevices = lib.mkForce false;

      # ================================

      # Personal:
      ProtectHome = true;
      ProtectSystem = "strict";
    };
  };
}