diff --git a/spec/eientei/jellyfin.nix b/spec/eientei/jellyfin.nix new file mode 100644 index 00000000..75003a31 --- /dev/null +++ b/spec/eientei/jellyfin.nix @@ -0,0 +1,33 @@ +{ pkgs +, config +, ...}: { + services.jellyfin = { + enable = true; + openFirewall = true; + dataDir = "/nix/persist/service/jellyfin"; + }; + + users.users.jellyfin.uid = 282; + users.groups.jellyfin.gid = 282; + + services.nginx.virtualHosts."jellyfin.514fpv.io" = { + useACMEHost = ".514fpv.io"; + addSSL = true; + locations = { + "= /".return = "302 https://jellyfin.514fpv.io:2096/web/"; + "/" = { + proxyPass = "http://127.0.0.1:8096"; + extraConfig = '' + proxy_buffering off; + ''; + }; + "= /web/".proxyPass = "http://127.0.0.1:8096/web/index.html"; + "/socket" = { + proxyPass = "http://127.0.0.1:8096"; + proxyWebsockets = true; + }; + }; + }; + + global.fs.zfs.mountpoints."/nix/persist/service/jellyfin" = "service/jellyfin"; +}