From 1ea1cc02bb0c9c992d9e52d4a10d0d3db6a3ce2e Mon Sep 17 00:00:00 2001 From: Oliver Davies Date: Tue, 24 Jun 2025 00:35:30 +0100 Subject: [PATCH] Refactor jellyfin configuration --- hosts/nixedo/homelab.nix | 1 - hosts/nixedo/modules/jellyfin.nix | 70 +++++++------------------------ 2 files changed, 14 insertions(+), 57 deletions(-) diff --git a/hosts/nixedo/homelab.nix b/hosts/nixedo/homelab.nix index f6004863..73982869 100644 --- a/hosts/nixedo/homelab.nix +++ b/hosts/nixedo/homelab.nix @@ -13,7 +13,6 @@ home-assistant.enable = true; homepage-dashboard.enable = true; immich.enable = true; - jellyfin.enable = true; jitsi.enable = true; paperless.enable = true; peertube.enable = true; diff --git a/hosts/nixedo/modules/jellyfin.nix b/hosts/nixedo/modules/jellyfin.nix index 1d08c62a..430fac28 100644 --- a/hosts/nixedo/modules/jellyfin.nix +++ b/hosts/nixedo/modules/jellyfin.nix @@ -1,65 +1,23 @@ -{ config, lib, ... }: - -with lib; - -let - cfg = homelab.services.${service}; - homelab = config.homelab; - service = "jellyfin"; -in { - options.homelab.services.${service} = { - enable = mkEnableOption "Enable ${service}"; + services.jellyfin = { + enable = true; - url = mkOption { - default = "${service}.${homelab.domain}"; - type = types.str; - }; - - homepage.name = mkOption { - default = "Jellyfin"; - type = types.str; - }; - - homepage.description = mkOption { - default = "The Free Software Media System"; - type = types.str; - }; - - homepage.icon = mkOption { - default = "jellyfin"; - type = types.str; - }; - - homepage.category = mkOption { - default = "Media"; - type = types.str; - }; + configDir = "/mnt/media/jellyfin"; + group = "media"; + openFirewall = true; }; - config = mkIf cfg.enable { - services = { - ${service} = { - enable = true; + services.nginx.virtualHosts."jellyfin.oliverdavies.uk" = { + forceSSL = true; + useACMEHost = "oliverdavies.uk"; - configDir = "/mnt/media/${service}"; - group = "media"; - openFirewall = true; - }; + locations."/" = { + proxyPass = "http://localhost:8096"; + recommendedProxySettings = true; - nginx.virtualHosts."${cfg.url}" = { - forceSSL = true; - useACMEHost = homelab.domain; - - locations."/" = { - proxyPass = "http://localhost:8096"; - recommendedProxySettings = true; - - extraConfig = '' - proxy_buffering off; - ''; - }; - }; + extraConfig = '' + proxy_buffering off; + ''; }; }; }