moved service config out of host namespace

This commit is contained in:
Leyla Becker 2025-03-22 13:27:04 -05:00
parent c7938c3fe7
commit 597c25b49d
7 changed files with 98 additions and 125 deletions

View file

@ -8,8 +8,7 @@
jellyfin_data_directory = "/var/lib/jellyfin";
jellyfin_cache_directory = "/var/cache/jellyfin";
in {
options.host.jellyfin = {
enable = lib.mkEnableOption "should jellyfin be enabled on this computer";
options.services.jellyfin = {
subdomain = lib.mkOption {
type = lib.types.str;
description = "subdomain of base domain that jellyfin will be hosted at";
@ -27,16 +26,14 @@ in {
};
};
config = lib.mkIf config.host.jellyfin.enable (
config = lib.mkIf config.services.jellyfin.enable (
lib.mkMerge [
{
services.jellyfin.enable = true;
host.reverse_proxy.subdomains.jellyfin = {
target = "http://localhost:${toString jellyfinPort}";
subdomain = config.host.jellyfin.subdomain;
extraSubdomains = config.host.jellyfin.extraSubdomains;
subdomain = config.services.jellyfin.subdomain;
extraSubdomains = config.services.jellyfin.extraSubdomains;
forwardHeaders.enable = true;
@ -107,8 +104,6 @@ in {
environment.persistence = {
"/persist/system/root" = {
enable = true;
hideMounts = true;
directories = [
{
directory = jellyfin_data_directory;
@ -128,7 +123,7 @@ in {
hideMounts = true;
directories = [
{
directory = config.host.jellyfin.media_directory;
directory = config.services.jellyfin.media_directory;
user = "jellyfin";
group = "jellyfin_media";
mode = "1770";