From 5d73a7811591bca6393686d8ce72bf039a8629b7 Mon Sep 17 00:00:00 2001 From: Nick Date: Mon, 13 Oct 2025 23:27:40 -0500 Subject: [PATCH] feat: fixed postgres backups --- modules/nixos/services/postgresql/default.nix | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/modules/nixos/services/postgresql/default.nix b/modules/nixos/services/postgresql/default.nix index dc84a70..c9ff489 100755 --- a/modules/nixos/services/postgresql/default.nix +++ b/modules/nixos/services/postgresql/default.nix @@ -1,4 +1,4 @@ -{ flake, ... }: +{ flake, lib, ... }: let inherit (flake.config.machines.devices) ceres @@ -53,9 +53,20 @@ in instances.syncthing.name ]; + systemd.services = { + postgresqlBackup-firefly-iii = { + serviceConfig = { + Group = lib.mkForce instances.syncthing.name; + }; + }; + postgresqlBackup-mastodon = { + serviceConfig = { + Group = lib.mkForce instances.syncthing.name; + }; + }; + }; + system.activationScripts.postgresCommands = '' - if [ ! -d "${service.paths.path0}/15" ]; then - chown -R ${service.name}:${service.name} ${service.paths.path0} - fi + chown -R ${service.name}:${service.name} ${service.paths.path0} ''; }