feat: added vaultwarden to syncthing backups

This commit is contained in:
Nick 2025-10-13 21:44:00 -05:00
parent 47061534c0
commit c93b98cc1b
3 changed files with 21 additions and 13 deletions

View file

@ -4,15 +4,18 @@
...
}:
let
inherit (flake.config.services.instances) smtp vaultwarden web;
service = vaultwarden;
localhost = web.localhost.address0;
inherit (flake.config.services) instances;
service = instances.vaultwarden;
localhost = instances.web.localhost.address0;
host = service.domains.url0;
syncthing = instances.syncthing;
backupPath = "${syncthing.paths.path1}/${service.name}";
in
{
services = {
vaultwarden = {
backupDir = service.paths.path0;
backupDir = backupPath;
enable = true;
environmentFile = config.sops.secrets."${service.name}/env".path;
config = {
@ -24,8 +27,8 @@ in
SMTP_EMBED_IMAGES = true;
SMTP_FROM = service.email.address0;
SMTP_FROM_NAME = service.label;
SMTP_HOST = smtp.hostname;
SMTP_PORT = smtp.ports.port0;
SMTP_HOST = instances.smtp.hostname;
SMTP_PORT = instances.smtp.ports.port0;
SMTP_SECURITY = "starttls";
SMTP_USERNAME = service.email.address0;
@ -88,6 +91,10 @@ in
"Z ${service.sops.path0} 755 ${service.name} ${service.name} -"
];
users.users.${service.name}.extraGroups = [
syncthing.name
];
networking = {
firewall = {
allowedTCPPorts = [