From a61b10967888eeaf44c7848a6edb73e3940f8bbd Mon Sep 17 00:00:00 2001 From: wo2wz <189177184+wo2wz@users.noreply.github.com> Date: Wed, 17 Dec 2025 15:07:08 -0500 Subject: [PATCH] drone: add backup for syncthing files --- .../services/homeserver/restic/backups.nix | 22 +++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/modules/nixos/services/homeserver/restic/backups.nix b/modules/nixos/services/homeserver/restic/backups.nix index 4d9e33e..246e0e3 100644 --- a/modules/nixos/services/homeserver/restic/backups.nix +++ b/modules/nixos/services/homeserver/restic/backups.nix @@ -40,8 +40,6 @@ script = "rm -r /var/backups/db-backup"; serviceConfig.Type = "oneshot"; }; - - restic-backups-main.serviceConfig.Type = "oneshot"; }; services.restic.backups.main = { @@ -79,4 +77,24 @@ "/var/lib/vaultwarden/tmp/*" ]; }; + + services.restic.backups.syncthing = { + user = "restic-backup"; + package = pkgs.writeShellScriptBin "restic" '' + exec /run/wrappers/bin/restic "$@" + ''; + + environmentFile = config.sops.secrets."restic/rest-auth.env".path; + passwordFile = config.sops.secrets."restic/password".path; + timerConfig = { + OnCalendar = "03:05"; + Persistent = true; + }; + + repository = "rest:http://localhost:8001/drone/syncthing"; + initialize = true; + + paths = [ "/var/lib/syncthing" ]; + exclude = [ "/var/lib/syncthing/.*" ]; + }; }