server.nix/services/jellyfin.nix

72 lines
1.5 KiB
Nix
Raw Permalink Normal View History

2025-01-17 20:55:33 +02:00
{ ... }:
let
ports = {
jellyfin = 8096;
jellyfin_vue = 4004;
};
in
{
2024-11-13 00:52:46 +02:00
virtualisation.oci-containers.containers.jellyfin-vue = {
autoStart = true;
image = "docker.io/jellyfin/jellyfin-vue:unstable";
ports = [
2025-01-17 20:55:33 +02:00
"${toString ports.jellyfin_vue}:80"
2024-11-13 00:52:46 +02:00
];
};
2024-11-18 23:34:56 +02:00
nixpkgs.overlays = [
(
final: prev:
{
jellyfin-web = prev.jellyfin-web.overrideAttrs (finalAttrs: previousAttrs: {
installPhase = ''
runHook preInstall
# this is the important line
sed -i "s#</head>#<script src=\"configurationpage?name=skip-intro-button.js\"></script></head>#" dist/index.html
mkdir -p $out/share
cp -a dist $out/share/jellyfin-web
runHook postInstall
'';
});
}
)
];
2024-11-13 00:52:46 +02:00
services = {
# /var/lib/jellyfin
jellyfin.enable = true;
caddy.virtualHosts = {
2024-11-30 15:38:34 +02:00
"vue.jellyfin.catnip.ee".extraConfig = ''
tls {
dns cloudflare {env.CLOUDFLARE_API_TOKEN}
resolvers 1.1.1.1
}
2024-11-13 00:52:46 +02:00
2025-01-17 20:55:33 +02:00
reverse_proxy :${toString ports.jellyfin_vue}
2024-11-30 15:38:34 +02:00
'';
"jellyfin.catnip.ee".extraConfig = ''
tls {
dns cloudflare {env.CLOUDFLARE_API_TOKEN}
resolvers 1.1.1.1
}
2024-11-13 00:52:46 +02:00
2025-01-17 20:55:33 +02:00
reverse_proxy :${toString ports.jellyfin}
2024-11-30 15:38:34 +02:00
'';
2024-11-13 00:52:46 +02:00
};
borgbackup.jobs."borgbase" = {
paths = [
"/var/lib/jellyfin"
];
exclude = [
"/var/lib/jellyfin/transcodes"
];
};
};
2024-11-30 01:10:27 +02:00
}