nixos-config/services/jellyfin.nix

43 lines
716 B
Nix
Raw Normal View History

2022-04-10 11:54:58 +02:00
{
config,
lib,
pkgs,
...
}: let
inherit
(lib)
2022-01-11 16:08:21 +01:00
mkEnableOption
mkIf
2022-04-10 11:54:58 +02:00
;
2022-01-11 16:08:21 +01:00
2021-02-19 21:21:35 +01:00
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";
};
2022-01-11 16:08:21 +01:00
config = mkIf cfg.enable {
2021-02-19 21:21:35 +01:00
services.jellyfin = {
enable = true;
group = "media";
};
# Proxy to Jellyfin
services.nginx.virtualHosts."jellyfin.${domain}" = {
forceSSL = true;
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
};
};
}