42 lines
1 KiB
Nix
42 lines
1 KiB
Nix
|
{
|
||
|
inputs,
|
||
|
config,
|
||
|
lib,
|
||
|
pkgs,
|
||
|
system,
|
||
|
...
|
||
|
}:
|
||
|
let
|
||
|
cfg = config.suites.nas.media.jellyfin;
|
||
|
in
|
||
|
{
|
||
|
options.suites.nas.media.jellyfin.enable = lib.mkOption {
|
||
|
type = with lib.types; uniq bool;
|
||
|
default = false;
|
||
|
description = "Enable Preconfigured Jellyfin Config";
|
||
|
};
|
||
|
options.suites.nas.media.jellyfin.subdomain = lib.mkOption {
|
||
|
type = with lib.types; string;
|
||
|
default = "watch";
|
||
|
description = "Subdomain for Jellyfin Server";
|
||
|
};
|
||
|
|
||
|
config = lib.mkIf (cfg.enable) {
|
||
|
|
||
|
services.jellyfin.enable = true;
|
||
|
services.jellyfin.user = "media";
|
||
|
|
||
|
# Configure Reverse-Proxy
|
||
|
services.traefik.dynamicConfigOptions = {
|
||
|
http.services.jellyfin.loadBalancer.servers = [ { url = "http://localhost:8096/"; } ];
|
||
|
http.routers.jellyfin.entrypoints = "websecure";
|
||
|
http.routers.jellyfin.tls = true;
|
||
|
#http.routers.jellyfin.tls.certresolver = "letsencrypt";
|
||
|
http.routers.jellyfin.rule = "Host(`${cfg.subdomain}.${config.suites.nas.domain}`)";
|
||
|
http.routers.jellyfin.service = "jellyfin";
|
||
|
};
|
||
|
|
||
|
};
|
||
|
}
|
||
|
|