2021-02-19 21:21:35 +01:00
|
|
|
{ config, lib, pkgs, ... }:
|
|
|
|
|
|
|
|
with lib;
|
|
|
|
|
|
|
|
let
|
|
|
|
cfg = config.my.services.jellyfin;
|
|
|
|
my = config.my;
|
|
|
|
|
|
|
|
domain = config.networking.domain;
|
|
|
|
|
|
|
|
# hardcoded in NixOS module :(
|
|
|
|
jellyfinPort = 8096;
|
|
|
|
in {
|
|
|
|
options.my.services.jellyfin = {
|
|
|
|
enable = mkEnableOption "Jellyfin";
|
|
|
|
};
|
|
|
|
|
|
|
|
config = lib.mkIf cfg.enable {
|
|
|
|
services.jellyfin = {
|
|
|
|
enable = true;
|
|
|
|
group = "media";
|
|
|
|
};
|
|
|
|
|
|
|
|
# Proxy to Jellyfin
|
|
|
|
services.nginx.virtualHosts."jellyfin.${domain}" = {
|
|
|
|
forceSSL = true;
|
2021-07-13 00:57:33 +02:00
|
|
|
useACMEHost = domain;
|
2021-02-19 21:21:35 +01:00
|
|
|
|
2021-02-22 11:58:54 +01:00
|
|
|
locations."/" = {
|
|
|
|
proxyPass = "http://localhost:${toString jellyfinPort}/";
|
|
|
|
proxyWebsockets = true;
|
|
|
|
};
|
2021-02-19 21:21:35 +01:00
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|