38 lines
		
	
	
	
		
			986 B
		
	
	
	
		
			Nix
		
	
	
	
	
	
			
		
		
	
	
			38 lines
		
	
	
	
		
			986 B
		
	
	
	
		
			Nix
		
	
	
	
	
	
{
 | 
						|
  lib,
 | 
						|
  config,
 | 
						|
  ...
 | 
						|
}: let
 | 
						|
  jellyfinPort = 8096;
 | 
						|
in {
 | 
						|
  options.services.jellyfin = {
 | 
						|
    subdomain = lib.mkOption {
 | 
						|
      type = lib.types.str;
 | 
						|
      description = "subdomain of base domain that jellyfin will be hosted at";
 | 
						|
      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.services.jellyfin.enable && config.host.reverse_proxy.enable) {
 | 
						|
    host.reverse_proxy.subdomains.jellyfin = {
 | 
						|
      target = "http://localhost:${toString jellyfinPort}";
 | 
						|
 | 
						|
      subdomain = config.services.jellyfin.subdomain;
 | 
						|
      extraSubdomains = config.services.jellyfin.extraSubdomains;
 | 
						|
 | 
						|
      forwardHeaders.enable = true;
 | 
						|
 | 
						|
      extraConfig = ''
 | 
						|
        client_max_body_size 20M;
 | 
						|
        add_header X-Content-Type-Options "nosniff";
 | 
						|
 | 
						|
        proxy_buffering off;
 | 
						|
      '';
 | 
						|
    };
 | 
						|
  };
 | 
						|
}
 |