server-configuration/services/jellyfin.nix
2025-03-03 16:09:32 +01:00

53 lines
1.1 KiB
Nix

{ pkgs, ... }:
let
host = "127.0.0.1";
port = 8096;
in
{
# Enable VAAPI
nixpkgs.config.packageOverrides = pkgs: {
vaapiIntel = pkgs.vaapiIntel.override { enableHybridCodec = true; };
};
hardware.graphics = {
enable = true;
extraPackages = with pkgs; [
intel-media-driver
intel-vaapi-driver
vaapiVdpau
intel-compute-runtime # OpenCL filter support (hardware tonemapping and subtitle burn-in)
vpl-gpu-rt # QSV on 11th gen or newer
];
};
# Enable Jellyfin
services.jellyfin = {
enable = true;
openFirewall = false;
};
# Route subdomain traffic to jellyfin
# services.caddy.virtualHosts."jf.spoodythe.one" = {
# enable = true;
# extraConfig = ''
# reverse_proxy * ${host}:${toString port}
# '';
# };
services.nginx = {
enable = true;
recommendedGzipSettings = true;
recommendedOptimisation = true;
recommendedProxySettings = true;
recommendedTlsSettings = true;
virtualHosts."media.spoodythe.one" = {
addSSL = true;
enableACME = true;
locations."/" = {
proxyPass = "http://${host}:${toString port}";
};
};
};
}