2025-03-29 23:08:26 -05:00
|
|
|
{ flake, ... }:
|
|
|
|
let
|
2025-06-08 22:39:09 -05:00
|
|
|
inherit (flake.config.people) user0;
|
|
|
|
inherit (flake.config.machines.devices) ceres;
|
|
|
|
inherit (flake.config.services.instances) jellyfin web;
|
2025-03-29 23:08:26 -05:00
|
|
|
service = jellyfin;
|
|
|
|
localhost = web.localhost.address0;
|
|
|
|
host = "${service.subdomain}.${web.domains.url0}";
|
|
|
|
in
|
|
|
|
{
|
|
|
|
services = {
|
|
|
|
jellyfin = {
|
2025-06-08 22:29:38 -05:00
|
|
|
enable = true;
|
2025-06-08 22:28:52 -05:00
|
|
|
openFirewall = true;
|
2025-03-29 23:08:26 -05:00
|
|
|
user = user0;
|
|
|
|
};
|
2025-06-08 22:28:52 -05:00
|
|
|
jellyseerr = {
|
|
|
|
openFirewall = true;
|
|
|
|
enable = true;
|
|
|
|
};
|
2025-03-29 23:08:26 -05:00
|
|
|
caddy = {
|
|
|
|
virtualHosts = {
|
|
|
|
"${host}" = {
|
|
|
|
extraConfig = ''
|
|
|
|
redir /.well-known/carddav /remote.php/dav/ 301
|
|
|
|
redir /.well-known/caldav /remote.php/dav/ 301
|
|
|
|
|
|
|
|
reverse_proxy ${localhost}:${toString service.ports.port1}
|
|
|
|
|
|
|
|
tls ${service.ssl.cert} ${service.ssl.key}
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2025-06-08 22:39:09 -05:00
|
|
|
fileSystems = {
|
|
|
|
"/var/lib/${service.name}" = {
|
|
|
|
device = service.paths.path0;
|
|
|
|
fsType = "none";
|
|
|
|
options = [ "bind" ];
|
|
|
|
depends = [ ceres.storage0.mount ];
|
|
|
|
};
|
|
|
|
"/var/cache/${service.name}" = {
|
|
|
|
device = service.paths.path1;
|
|
|
|
fsType = "none";
|
|
|
|
options = [ "bind" ];
|
|
|
|
depends = [ ceres.storage0.mount ];
|
2025-03-29 23:08:26 -05:00
|
|
|
};
|
2025-06-08 22:39:09 -05:00
|
|
|
};
|
2025-03-29 23:08:26 -05:00
|
|
|
|
|
|
|
systemd.tmpfiles.rules = [
|
|
|
|
"Z ${service.paths.path0} 0755 ${user0} ${service.name} -"
|
2025-06-08 22:39:09 -05:00
|
|
|
"Z ${service.paths.path1} 0755 ${user0} ${service.name} -"
|
2025-03-29 23:08:26 -05:00
|
|
|
];
|
|
|
|
|
|
|
|
networking = {
|
|
|
|
firewall = {
|
|
|
|
allowedTCPPorts = [
|
|
|
|
service.ports.port0
|
|
|
|
service.ports.port1
|
|
|
|
service.ports.port2
|
|
|
|
];
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|