mirror of
https://gitlab.com/upRootNutrition/dotfiles.git
synced 2025-06-15 09:35:12 -05:00
feat: test
This commit is contained in:
parent
1e3e2b820d
commit
b24ef4d52f
1 changed files with 72 additions and 0 deletions
72
modules/nixos/services/jellyfin/default.nix
Normal file
72
modules/nixos/services/jellyfin/default.nix
Normal file
|
@ -0,0 +1,72 @@
|
||||||
|
{ flake, ... }:
|
||||||
|
let
|
||||||
|
inherit (flake.config.people) user0;
|
||||||
|
inherit (flake.config.machines.devices) ceres;
|
||||||
|
inherit (flake.config.services.instances) jellyfin web;
|
||||||
|
service = jellyfin;
|
||||||
|
localhost = web.localhost.address0;
|
||||||
|
host = "${service.subdomain}.${web.domains.url0}";
|
||||||
|
in
|
||||||
|
{
|
||||||
|
services = {
|
||||||
|
jellyfin = {
|
||||||
|
enable = true;
|
||||||
|
openFirewall = true;
|
||||||
|
user = user0;
|
||||||
|
};
|
||||||
|
jellyseerr = {
|
||||||
|
openFirewall = true;
|
||||||
|
enable = true;
|
||||||
|
};
|
||||||
|
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}
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
fileSystems =
|
||||||
|
let
|
||||||
|
settings = {
|
||||||
|
fsType = "none";
|
||||||
|
options = [
|
||||||
|
"bind"
|
||||||
|
];
|
||||||
|
depends = [
|
||||||
|
ceres.storage0.mount
|
||||||
|
];
|
||||||
|
};
|
||||||
|
in
|
||||||
|
{
|
||||||
|
"/var/lib/${service.name}" = {
|
||||||
|
device = service.paths.path0;
|
||||||
|
} // settings;
|
||||||
|
"/var/cache/${service.name}" = {
|
||||||
|
device = "${service.paths.path1}";
|
||||||
|
} // settings;
|
||||||
|
};
|
||||||
|
|
||||||
|
systemd.tmpfiles.rules = [
|
||||||
|
"Z ${service.paths.path0} 0755 ${user0} ${service.name} -"
|
||||||
|
"Z ${service.paths.path0} 0755 ${user0} ${service.name} -"
|
||||||
|
];
|
||||||
|
|
||||||
|
networking = {
|
||||||
|
firewall = {
|
||||||
|
allowedTCPPorts = [
|
||||||
|
service.ports.port0
|
||||||
|
service.ports.port1
|
||||||
|
service.ports.port2
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
Loading…
Add table
Add a link
Reference in a new issue