2021-01-31 22:31:04 +01:00
|
|
|
# A FLOSS media server
|
|
|
|
{ config, lib, ... }:
|
|
|
|
let
|
|
|
|
cfg = config.my.services.jellyfin;
|
|
|
|
domain = config.networking.domain;
|
|
|
|
jellyfinDomain = "jellyfin.${config.networking.domain}";
|
|
|
|
in
|
|
|
|
{
|
|
|
|
options.my.services.jellyfin = {
|
|
|
|
enable = lib.mkEnableOption "Jellyfin Media Server";
|
|
|
|
};
|
|
|
|
|
|
|
|
config = lib.mkIf cfg.enable {
|
|
|
|
services.jellyfin = {
|
|
|
|
enable = true;
|
|
|
|
group = "media";
|
|
|
|
};
|
|
|
|
|
|
|
|
# Proxy to Jellyfin
|
|
|
|
services.nginx.virtualHosts."${jellyfinDomain}" = {
|
|
|
|
forceSSL = true;
|
2021-02-24 21:50:05 +01:00
|
|
|
useACMEHost = domain;
|
2021-01-31 22:31:04 +01:00
|
|
|
|
2021-02-24 12:55:44 +01:00
|
|
|
locations."/" = {
|
2021-03-27 16:48:49 +01:00
|
|
|
proxyPass = "http://127.0.0.1:8096/";
|
2021-02-24 12:55:44 +01:00
|
|
|
proxyWebsockets = true;
|
|
|
|
};
|
2021-01-31 22:31:04 +01:00
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|