From e8284d322b29d05a04fa902fc7818e48c0539808 Mon Sep 17 00:00:00 2001 From: Oliver Davies Date: Tue, 24 Jun 2025 00:35:30 +0100 Subject: [PATCH] Move jellyfin configuration --- hosts/nixedo/configuration.nix | 1 + hosts/nixedo/homelab.nix | 1 - hosts/nixedo/jellyfin.nix | 23 +++++++++++ hosts/nixedo/modules/default.nix | 1 - hosts/nixedo/modules/jellyfin.nix | 65 ------------------------------- 5 files changed, 24 insertions(+), 67 deletions(-) create mode 100644 hosts/nixedo/jellyfin.nix delete mode 100644 hosts/nixedo/modules/jellyfin.nix diff --git a/hosts/nixedo/configuration.nix b/hosts/nixedo/configuration.nix index 8395b58b..c2210305 100644 --- a/hosts/nixedo/configuration.nix +++ b/hosts/nixedo/configuration.nix @@ -11,6 +11,7 @@ ../common ./hardware-configuration.nix ./homelab.nix + ./jellyfin.nix ./modules ./ports.nix ./secrets.nix 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/jellyfin.nix b/hosts/nixedo/jellyfin.nix new file mode 100644 index 00000000..430fac28 --- /dev/null +++ b/hosts/nixedo/jellyfin.nix @@ -0,0 +1,23 @@ +{ + services.jellyfin = { + enable = true; + + configDir = "/mnt/media/jellyfin"; + group = "media"; + openFirewall = true; + }; + + services.nginx.virtualHosts."jellyfin.oliverdavies.uk" = { + forceSSL = true; + useACMEHost = "oliverdavies.uk"; + + locations."/" = { + proxyPass = "http://localhost:8096"; + recommendedProxySettings = true; + + extraConfig = '' + proxy_buffering off; + ''; + }; + }; +} diff --git a/hosts/nixedo/modules/default.nix b/hosts/nixedo/modules/default.nix index 20a9d6cf..f5b14763 100644 --- a/hosts/nixedo/modules/default.nix +++ b/hosts/nixedo/modules/default.nix @@ -25,7 +25,6 @@ with lib; ./forgejo.nix ./home-assistant.nix ./immich.nix - ./jellyfin.nix ./jitsi.nix ./nginx ./paperless.nix diff --git a/hosts/nixedo/modules/jellyfin.nix b/hosts/nixedo/modules/jellyfin.nix deleted file mode 100644 index 1d08c62a..00000000 --- a/hosts/nixedo/modules/jellyfin.nix +++ /dev/null @@ -1,65 +0,0 @@ -{ config, lib, ... }: - -with lib; - -let - cfg = homelab.services.${service}; - homelab = config.homelab; - service = "jellyfin"; -in -{ - options.homelab.services.${service} = { - enable = mkEnableOption "Enable ${service}"; - - 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; - }; - }; - - config = mkIf cfg.enable { - services = { - ${service} = { - enable = true; - - configDir = "/mnt/media/${service}"; - group = "media"; - openFirewall = true; - }; - - nginx.virtualHosts."${cfg.url}" = { - forceSSL = true; - useACMEHost = homelab.domain; - - locations."/" = { - proxyPass = "http://localhost:8096"; - recommendedProxySettings = true; - - extraConfig = '' - proxy_buffering off; - ''; - }; - }; - }; - }; -}