2023-08-31 01:55:45 +03:00
|
|
|
{ config, depot, lib, pkgs, ... }:
|
|
|
|
with depot.lib.nginx;
|
2021-10-16 21:22:58 +03:00
|
|
|
{
|
|
|
|
# TODO: not a whole lot to configure, maybe add some autoconfig stuff
|
|
|
|
services.jellyfin = {
|
|
|
|
enable = true;
|
2023-06-20 17:38:49 +03:00
|
|
|
package = depot.packages.jellyfin;
|
2021-10-16 21:22:58 +03:00
|
|
|
};
|
2023-08-31 01:55:45 +03:00
|
|
|
services.nginx.virtualHosts."warehouse.${depot.lib.meta.domain}" = lib.mkMerge [
|
2021-10-16 21:22:58 +03:00
|
|
|
(vhosts.proxy "http://127.0.0.1:8096")
|
|
|
|
{
|
|
|
|
locations."/".extraConfig = ''
|
|
|
|
proxy_buffering off;
|
|
|
|
'';
|
|
|
|
locations."/socket" = {
|
2023-08-31 01:55:45 +03:00
|
|
|
inherit (config.services.nginx.virtualHosts."warehouse.${depot.lib.meta.domain}".locations."/") proxyPass;
|
2021-10-16 21:22:58 +03:00
|
|
|
proxyWebsockets = true;
|
|
|
|
};
|
|
|
|
# TODO: video cache
|
|
|
|
}
|
|
|
|
];
|
|
|
|
|
|
|
|
hardware.opengl = {
|
|
|
|
enable = true;
|
2022-05-27 18:02:01 +03:00
|
|
|
package = pkgs.intel-media-driver;
|
2021-10-16 21:22:58 +03:00
|
|
|
};
|
2023-08-29 01:23:47 +03:00
|
|
|
systemd.services.jellyfin = {
|
|
|
|
# if EncoderAppPath is manually set in the web UI, it can never be updated through --ffmpeg
|
|
|
|
preStart = "test ! -e /var/lib/jellyfin/config/encoding.xml || sed -i '/<EncoderAppPath>/d' /var/lib/jellyfin/config/encoding.xml";
|
|
|
|
serviceConfig = {
|
|
|
|
# allow access to GPUs for hardware transcoding
|
|
|
|
DeviceAllow = lib.mkForce "char-drm";
|
|
|
|
BindPaths = lib.mkForce "/dev/dri";
|
|
|
|
# to allow restarting from web ui
|
|
|
|
Restart = lib.mkForce "always";
|
2021-10-16 21:22:58 +03:00
|
|
|
|
2023-08-29 01:23:47 +03:00
|
|
|
Slice = "mediaplayback.slice";
|
|
|
|
};
|
2021-10-16 21:22:58 +03:00
|
|
|
};
|
|
|
|
}
|