2024-08-08 09:02:42 +08:00
|
|
|
{...}: let
|
2024-06-16 23:08:52 +08:00
|
|
|
port = "8096";
|
2024-08-08 09:02:42 +08:00
|
|
|
in {
|
2024-01-23 09:45:42 +08:00
|
|
|
virtualisation.oci-containers.containers = {
|
|
|
|
# Volunteer-built media solution that puts you in control of your media
|
|
|
|
jellyfin = {
|
|
|
|
autoStart = true;
|
2024-11-22 07:24:36 +08:00
|
|
|
image = "jellyfin/jellyfin:10.10.3";
|
2024-01-23 09:45:42 +08:00
|
|
|
ports = [
|
2024-06-16 23:08:52 +08:00
|
|
|
"${port}:8096/tcp" # HTTP traffic
|
2024-01-23 09:45:42 +08:00
|
|
|
"8920:8920/tcp" # HTTPS traffic
|
|
|
|
# "1900:1900/udp" # Service auto-discovery
|
|
|
|
"7359:7359/udp" # Client auto-discovery
|
|
|
|
];
|
|
|
|
volumes = [
|
|
|
|
# Media library
|
|
|
|
"/srv/multimedia/library:/media:ro"
|
|
|
|
# Container data
|
2024-10-16 04:59:59 +08:00
|
|
|
"/srv/multimedia/containers/jellyfin/config:/config:rw"
|
|
|
|
"/srv/multimedia/containers/jellyfin/cache:/cache:rw"
|
2024-01-23 09:45:42 +08:00
|
|
|
];
|
2024-06-17 17:29:08 +08:00
|
|
|
environment = {
|
|
|
|
PUID = "1000";
|
|
|
|
PGID = "100";
|
|
|
|
};
|
2024-01-23 09:45:42 +08:00
|
|
|
extraOptions = [
|
|
|
|
"--group-add=303"
|
|
|
|
"--device=/dev/dri/renderD128:/dev/dri/renderD128"
|
|
|
|
"--network=media-stack"
|
|
|
|
];
|
|
|
|
};
|
|
|
|
};
|
2024-06-05 21:14:22 +08:00
|
|
|
|
|
|
|
services.traefik.dynamicConfigOptions.http.routers = {
|
|
|
|
jellyfin = {
|
2024-11-22 07:15:34 +08:00
|
|
|
rule = "Host(`jellyfin.home.arpa`)";
|
2024-06-05 21:14:22 +08:00
|
|
|
entryPoints = [
|
|
|
|
"websecure"
|
|
|
|
];
|
|
|
|
middlewares = [
|
|
|
|
"internal"
|
|
|
|
];
|
|
|
|
service = "jellyfin";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
services.traefik.dynamicConfigOptions.http.services = {
|
|
|
|
jellyfin.loadBalancer.servers = [
|
2024-08-08 09:02:42 +08:00
|
|
|
{url = "http://127.0.0.1:${port}";}
|
2024-06-05 21:14:22 +08:00
|
|
|
];
|
|
|
|
};
|
2024-01-23 09:45:42 +08:00
|
|
|
}
|