From 1c65610138fe667c3b684129f0523628b707bfe6 Mon Sep 17 00:00:00 2001 From: Nick Date: Fri, 10 Oct 2025 00:14:36 -0500 Subject: [PATCH] feat: added syncthing --- modules/config/instances/config/syncthing.nix | 4 ++++ modules/nixos/services/postgresql/default.nix | 6 +++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/modules/config/instances/config/syncthing.nix b/modules/config/instances/config/syncthing.nix index db583c0..bbb8e0e 100755 --- a/modules/config/instances/config/syncthing.nix +++ b/modules/config/instances/config/syncthing.nix @@ -2,6 +2,7 @@ let inherit (moduleFunctions.instancesFunctions) domain0 + servicePath sslPath sopsPath synologyName @@ -18,6 +19,9 @@ in sops = { path0 = "${sopsPath}/${name}"; }; + paths = { + path0 = "${servicePath}/${name}"; + }; domains = { url0 = domain; }; diff --git a/modules/nixos/services/postgresql/default.nix b/modules/nixos/services/postgresql/default.nix index 3155906..309cbbe 100755 --- a/modules/nixos/services/postgresql/default.nix +++ b/modules/nixos/services/postgresql/default.nix @@ -8,12 +8,13 @@ let ; service = instances.postgresql; + backupPath = "${instances.syncthing.paths.path0}/postgres-backups"; in { services = { postgresqlBackup = { enable = true; - location = "${service.paths.path0}/backups"; + location = backupPath; compression = "zstd"; startAt = "*-*-* 07:00:00"; databases = [ @@ -53,8 +54,7 @@ in }; systemd.tmpfiles.rules = [ - "Z ${service.paths.path0} 700 ${service.name} ${service.name} -" - "Z ${service.paths.path0}/backups 700 ${service.name} ${service.name} -" + "d ${backupPath} 0750 ${service.name} ${instances.syncthing.name} -" ]; users.users.${service.name}.extraGroups = [