nix-config/hosts/nixedo/modules/jellyfin.nix

66 lines
1.3 KiB
Nix
Raw Normal View History

2025-04-30 01:10:02 +01:00
{ config, lib, ... }:
with lib;
let
cfg = homelab.services.${service};
homelab = config.features.homelab;
2025-04-30 01:10:02 +01:00
service = "jellyfin";
in
2024-11-26 08:40:00 +00:00
{
options.features.homelab.services.${service} = {
2025-04-30 01:10:02 +01:00
enable = mkEnableOption "Enable ${service}";
url = mkOption {
default = "${service}.${homelab.baseDomain}";
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;
};
2025-04-30 01:10:02 +01:00
};
config = mkIf cfg.enable {
services = {
${service} = {
enable = true;
2025-04-30 01:10:02 +01:00
configDir = "/mnt/media/${service}";
group = "media";
2025-04-30 01:10:02 +01:00
openFirewall = true;
};
2025-04-30 01:10:02 +01:00
nginx.virtualHosts."${cfg.url}" = {
forceSSL = true;
2025-04-30 01:10:02 +01:00
useACMEHost = homelab.baseDomain;
locations."/" = {
2025-04-30 01:10:02 +01:00
proxyPass = "http://localhost:8096";
2025-04-28 02:07:10 +01:00
recommendedProxySettings = true;
extraConfig = ''
proxy_buffering off;
'';
};
};
};
2025-04-30 01:10:02 +01:00
};
2024-11-26 08:40:00 +00:00
}