48 lines
1.1 KiB
Nix
48 lines
1.1 KiB
Nix
{ pkgs, lib, ... }:
|
|
|
|
let
|
|
network = import ./network.nix;
|
|
domain = "media.giugl.io";
|
|
auth_block = (import ./openid.nix { inherit lib; }).openresty_oidc_block;
|
|
in
|
|
{
|
|
services = {
|
|
jellyfin = {
|
|
enable = true;
|
|
group = "media";
|
|
package = pkgs.unstable.jellyfin;
|
|
};
|
|
|
|
nginx.virtualHosts.${domain} = {
|
|
forceSSL = true;
|
|
enableACME = true;
|
|
extraConfig = auth_block { access_role = "jellyfin"; whitelisted_ips = network.gdevices-wg; };
|
|
|
|
locations."/" = {
|
|
proxyPass = "http://127.0.0.1:8096";
|
|
};
|
|
|
|
locations."/socket" = {
|
|
proxyPass = "http://127.0.0.1:8096";
|
|
proxyWebsockets = true;
|
|
};
|
|
};
|
|
};
|
|
|
|
networking.extraHosts = ''
|
|
${network.architect-lan} ${domain}
|
|
${network.architect-wg} ${domain}
|
|
${network.architect-ts} ${domain}
|
|
'';
|
|
|
|
users.groups.media.members = [ "jellyfin" ];
|
|
users.groups.video.members = [ "jellyfin" ];
|
|
users.groups.render.members = [ "jellyfin" ];
|
|
|
|
fileSystems."/tmp/jellyfin" = {
|
|
device = "none";
|
|
fsType = "tmpfs";
|
|
options = [ "defaults" "size=20G" "uid=jellyfin" ];
|
|
};
|
|
}
|