summaryrefslogtreecommitdiffstats
path: root/makefu/2configs/home/jellyfin.nix
blob: e613a05fcf4ce28215b804ed24e74a89dec94177 (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
{ lib, config, ... }:
let
  port = 8096;
in
{
        services.jellyfin.enable = true;
        # services.jellyfin.openFirewall = true;
        networking.firewall.interfaces.wiregrill = {
          allowedTCPPorts = [ 80 port 8920 ];
          allowedUDPPorts = [ 1900 7359 ];
        };
        state = [ "/var/lib/jellyfin" ];
        users.users.${config.services.jellyfin.user}.extraGroups = [ "download" "video" "render" ];

        systemd.services.jellyfin = {
        after = [ "media-cloud.mount" ];
        serviceConfig = rec {
          RequiresMountFor = [ "/media/cloud" ];
          SupplementaryGroups = lib.mkForce [ "video" "render" "download" ];
          UMask = lib.mkForce "0077";
      };
    };
  services.nginx.virtualHosts."jelly" = {
    serverAliases = [
      "jelly.lan" "movies.lan"
      "jelly.makefu.w"  "makefu.omo.w"
    ];

    locations."/" = {
      proxyPass = "http://localhost:${toString port}";
      proxyWebsockets = true;
    };
  };
}