feat: added syncthing

This commit is contained in:
Nick 2025-10-10 02:03:44 -05:00
parent 5da8744578
commit 5a5f7ed62d
4 changed files with 34 additions and 31 deletions

View file

@ -6,16 +6,17 @@
}:
let
inherit (flake.config.machines.devices) ceres;
inherit (flake.config.services.instances)
smtp
forgejo
syncthing
web
inherit (flake.config.services)
instances
;
service = forgejo;
localhost = web.localhost.address0;
service = instances.forgejo;
localhost = instances.web.localhost.address0;
host = service.domains.url0;
backupPath = "${syncthing.paths.path0}/postgres-backups/${service.name}";
caddy = instances.caddy;
postgres = instances.postgresql;
syncthing = instances.syncthing;
backupPath = "${instances.syncthing.paths.path1}/${service.name}";
in
{
services = {
@ -51,11 +52,11 @@ in
};
mailer = {
ENABLED = true;
SMTP_ADDR = smtp.hostname;
SMTP_ADDR = instances.smtp.hostname;
FROM = service.email.address0;
USER = service.email.address0;
PROTOCOL = "smtp+starttls";
SMTP_PORT = smtp.ports.port0;
SMTP_PORT = instances.smtp.ports.port0;
SEND_AS_PLAIN_TEXT = true;
USE_CLIENT_CERT = false;
};
@ -117,13 +118,12 @@ in
systemd.tmpfiles.rules = [
"Z ${service.paths.path0} 755 ${service.name} ${service.name} -"
"Z ${service.sops.path0} 755 ${service.name} ${service.name} -"
"d ${backupPath} 0750 ${service.name} ${syncthing.name} -"
];
users.users.${service.name}.extraGroups = [
"caddy"
"postgres"
"syncthing"
caddy.name
postgres.name
syncthing.name
];
networking = {