Refactor jellyfin configuration

This commit is contained in:
Oliver Davies 2025-06-24 00:35:30 +01:00
parent d25628813b
commit 1ea1cc02bb
2 changed files with 14 additions and 57 deletions

View file

@ -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;

View file

@ -1,55 +1,15 @@
{ 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} = {
services.jellyfin = {
enable = true;
configDir = "/mnt/media/${service}";
configDir = "/mnt/media/jellyfin";
group = "media";
openFirewall = true;
};
nginx.virtualHosts."${cfg.url}" = {
services.nginx.virtualHosts."jellyfin.oliverdavies.uk" = {
forceSSL = true;
useACMEHost = homelab.domain;
useACMEHost = "oliverdavies.uk";
locations."/" = {
proxyPass = "http://localhost:8096";
@ -60,6 +20,4 @@ in
'';
};
};
};
};
}