feat: added syncthing

This commit is contained in:
Nick 2025-10-10 00:14:36 -05:00
parent 7e84a2b77d
commit 1c65610138
2 changed files with 7 additions and 3 deletions

View file

@ -2,6 +2,7 @@
let let
inherit (moduleFunctions.instancesFunctions) inherit (moduleFunctions.instancesFunctions)
domain0 domain0
servicePath
sslPath sslPath
sopsPath sopsPath
synologyName synologyName
@ -18,6 +19,9 @@ in
sops = { sops = {
path0 = "${sopsPath}/${name}"; path0 = "${sopsPath}/${name}";
}; };
paths = {
path0 = "${servicePath}/${name}";
};
domains = { domains = {
url0 = domain; url0 = domain;
}; };

View file

@ -8,12 +8,13 @@ let
; ;
service = instances.postgresql; service = instances.postgresql;
backupPath = "${instances.syncthing.paths.path0}/postgres-backups";
in in
{ {
services = { services = {
postgresqlBackup = { postgresqlBackup = {
enable = true; enable = true;
location = "${service.paths.path0}/backups"; location = backupPath;
compression = "zstd"; compression = "zstd";
startAt = "*-*-* 07:00:00"; startAt = "*-*-* 07:00:00";
databases = [ databases = [
@ -53,8 +54,7 @@ in
}; };
systemd.tmpfiles.rules = [ systemd.tmpfiles.rules = [
"Z ${service.paths.path0} 700 ${service.name} ${service.name} -" "d ${backupPath} 0750 ${service.name} ${instances.syncthing.name} -"
"Z ${service.paths.path0}/backups 700 ${service.name} ${service.name} -"
]; ];
users.users.${service.name}.extraGroups = [ users.users.${service.name}.extraGroups = [