2023-04-17 02:23:56 +02:00
|
|
|
{ config, pkgs, lib, ... }:
|
2024-05-31 18:28:54 +02:00
|
|
|
|
|
|
|
{
|
2023-04-17 02:23:56 +02:00
|
|
|
# Jellyfin - Media Streaming platform
|
|
|
|
services.jellyfin.enable = true;
|
2024-05-31 18:28:54 +02:00
|
|
|
|
2023-04-19 10:48:16 +02:00
|
|
|
users.users.${config.services.jellyfin.user}.extraGroups = [ "video" "render" ];
|
2024-05-31 18:28:54 +02:00
|
|
|
|
2023-04-19 10:48:16 +02:00
|
|
|
systemd.services.jellyfin.serviceConfig = {
|
|
|
|
DeviceAllow = lib.mkForce [ "/dev/dri/card0" ];
|
|
|
|
};
|
2023-04-17 02:23:56 +02:00
|
|
|
|
2024-05-31 18:28:54 +02:00
|
|
|
services.nginx.virtualHosts."jellyfin.home.feal.no" = {
|
2023-06-07 20:23:49 +02:00
|
|
|
serverAliases = [ "jf.feal.no" ];
|
2024-05-31 18:28:54 +02:00
|
|
|
locations = {
|
|
|
|
"= /" = {
|
|
|
|
return = "302 http://$host/web/";
|
|
|
|
};
|
|
|
|
|
|
|
|
"/" = {
|
|
|
|
proxyPass = "http://127.0.0.1:8096";
|
|
|
|
extraConfig = ''
|
|
|
|
proxy_buffering off;
|
2023-04-17 02:23:56 +02:00
|
|
|
'';
|
2024-05-31 18:28:54 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
"/socket" = {
|
|
|
|
proxyPass = "http://127.0.0.1:8096";
|
|
|
|
proxyWebsockets = true;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
extraConfig = ''
|
|
|
|
add_header X-XSS-Protection "1; mode=block";
|
|
|
|
add_header X-Content-Type-Options "nosniff";
|
|
|
|
add_header Permissions-Policy "accelerometer=(), ambient-light-sensor=(), battery=(), bluetooth=(), camera=(), clipboard-read=(), display-capture=(), document-domain=(), encrypted-media=(), gamepad=(), geolocation=(), gyroscope=(), hid=(), idle-detection=(), interest-cohort=(), keyboard-map=(), local-fonts=(), magnetometer=(), microphone=(), payment=(), publickey-credentials-get=(), serial=(), sync-xhr=(), usb=(), xr-spatial-tracking=()" always;
|
|
|
|
'';
|
|
|
|
};
|
2023-04-17 02:23:56 +02:00
|
|
|
|
2024-05-31 18:28:54 +02:00
|
|
|
fileSystems."/tank/media/jellyfin/Music" = {
|
2024-07-03 20:51:18 +02:00
|
|
|
device = "tank/media/music";
|
|
|
|
fsType = "zfs";
|
2023-04-17 02:23:56 +02:00
|
|
|
};
|
|
|
|
}
|