added extra jellyfin domain

This commit is contained in:
Leyla Becker 2025-03-04 21:39:12 -06:00
parent 34bc5b1933
commit 59bf355353
2 changed files with 19 additions and 3 deletions

View file

@ -97,6 +97,7 @@
jellyfin = { jellyfin = {
enable = true; enable = true;
subdomain = "media"; subdomain = "media";
extraSubdomains = ["jellyfin"];
}; };
forgejo = { forgejo = {
enable = true; enable = true;

View file

@ -16,15 +16,30 @@ in {
description = "subdomain of base domain that jellyfin will be hosted at"; description = "subdomain of base domain that jellyfin will be hosted at";
default = "jellyfin"; default = "jellyfin";
}; };
extraSubdomains = lib.mkOption {
type = lib.types.listOf lib.types.str;
description = "ex subdomain of base domain that jellyfin will be hosted at";
default = [];
};
}; };
config = lib.mkIf config.host.jellyfin.enable ( config = lib.mkIf config.host.jellyfin.enable (
lib.mkMerge [ lib.mkMerge [
{ {
services.jellyfin.enable = true; services.jellyfin.enable = true;
host.reverse_proxy.subdomains.${config.host.jellyfin.subdomain} = { host.reverse_proxy.subdomains = lib.mkMerge ([
target = "http://localhost:${toString jellyfinPort}"; {
}; ${config.host.jellyfin.subdomain} = {
target = "http://localhost:${toString jellyfinPort}";
};
}
]
++ (builtins.map (subdomain: {
${subdomain} = {
target = "http://localhost:${toString jellyfinPort}";
};
})
config.host.jellyfin.extraSubdomains));
environment.systemPackages = [ environment.systemPackages = [
pkgs.jellyfin pkgs.jellyfin
pkgs.jellyfin-web pkgs.jellyfin-web