mirror of
https://gitlab.com/upRootNutrition/dotfiles.git
synced 2025-06-16 18:15:13 -05:00
feat: refactored abstractions
This commit is contained in:
parent
f3897c1e0c
commit
2e0ba5f89e
23 changed files with 324 additions and 310 deletions
|
@ -1,10 +1,10 @@
|
|||
{flake, ...}: let
|
||||
inherit (flake.config.people) user0;
|
||||
inherit (flake.config.people.user.${user0}) domain;
|
||||
inherit (flake.config.system.device) server wildcard;
|
||||
inherit (flake.config.service.instance.jellyfin) paths ports name subdomain ssl;
|
||||
localhost = wildcard.ip.address0;
|
||||
host = "${subdomain}.${domain.url0}";
|
||||
inherit (flake.config.system.device) server;
|
||||
inherit (flake.config.service.instance) jellyfin web;
|
||||
service = jellyfin;
|
||||
localhost = web.localhost.address0;
|
||||
host = "${service.subdomain}.${web.domains.url0}";
|
||||
in {
|
||||
services = {
|
||||
jellyfin = {
|
||||
|
@ -23,9 +23,9 @@ in {
|
|||
redir /.well-known/carddav /remote.php/dav/ 301
|
||||
redir /.well-known/caldav /remote.php/dav/ 301
|
||||
|
||||
reverse_proxy ${localhost}:${toString ports.port1}
|
||||
reverse_proxy ${localhost}:${toString service.ports.port1}
|
||||
|
||||
tls ${ssl.cert} ${ssl.key}
|
||||
tls ${service.ssl.cert} ${service.ssl.key}
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
@ -39,29 +39,29 @@ in {
|
|||
depends = [server.storage0.mount];
|
||||
};
|
||||
in {
|
||||
"/var/lib/${name}" =
|
||||
"/var/lib/${service.name}" =
|
||||
{
|
||||
device = paths.path0;
|
||||
device = service.paths.path0;
|
||||
}
|
||||
// settings;
|
||||
"/var/cache/${name}" =
|
||||
"/var/cache/${service.name}" =
|
||||
{
|
||||
device = "${paths.path0}/cache";
|
||||
device = "${service.paths.path0}/cache";
|
||||
}
|
||||
// settings;
|
||||
};
|
||||
|
||||
systemd.tmpfiles.rules = [
|
||||
"Z ${paths.path0} 0755 ${user0} ${name} -"
|
||||
"Z ${paths.path0}/cache 0755 ${user0} ${name} -"
|
||||
"Z ${service.paths.path0} 0755 ${user0} ${service.name} -"
|
||||
"Z ${service.paths.path0}/cache 0755 ${user0} ${service.name} -"
|
||||
];
|
||||
|
||||
networking = {
|
||||
firewall = {
|
||||
allowedTCPPorts = [
|
||||
ports.port0
|
||||
ports.port1
|
||||
ports.port2
|
||||
service.ports.port0
|
||||
service.ports.port1
|
||||
service.ports.port2
|
||||
];
|
||||
};
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue