Configure Jellyfin

This commit is contained in:
Paul-Henri Froidmont 2021-12-07 01:55:01 +01:00
parent 7a2492d3fb
commit d8bbec67db
Signed by: phfroidmont
GPG key ID: BE948AFD7E7873BE
4 changed files with 49 additions and 8 deletions

33
modules/jellyfin.nix Normal file
View file

@ -0,0 +1,33 @@
{ config, lib, pkgs, ... }:
{
services.jellyfin = {
enable = true;
};
systemd.services.jellyfin.serviceConfig.ExecStart =
lib.mkOverride 10 "${config.services.jellyfin.package}/bin/jellyfin --datadir '/nix/var/data/jellyfin' --cachedir '/var/cache/jellyfin'";
services.nginx.virtualHosts."jellyfin.${config.networking.domain}" = {
enableACME = true;
forceSSL = true;
locations."= /".extraConfig = ''
return 302 https://$host/web/;
'';
locations."/" = {
proxyPass = "http://127.0.0.1:8096";
extraConfig = ''
proxy_buffering off;
'';
};
locations."= /web/" = {
proxyPass = "http://127.0.0.1:8096/web/index.html";
};
locations."/socket" = {
proxyPass = "http://127.0.0.1:8096";
};
};
}

View file

@ -55,15 +55,12 @@ in
};
};
services.nginx = {
virtualHosts = {
"${config.services.nextcloud.hostName}" = {
enableACME = true;
forceSSL = true;
};
};
services.nginx.virtualHosts."${config.services.nextcloud.hostName}" = {
enableACME = true;
forceSSL = true;
};
services.nextcloud = {
enable = true;
package = pkgs.nextcloud22;