From a5990dcb0a33c43f7df2fc020b4526f90ed6ff34 Mon Sep 17 00:00:00 2001 From: Benedikt Ritter Date: Wed, 4 Dec 2024 19:21:12 +0100 Subject: [PATCH] hosts (srv-test-2): Run nextcloud-sync nightly --- .../srv-test-2/nextcloud-sync.nix | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/systems/x86_64-linux/srv-test-2/nextcloud-sync.nix b/systems/x86_64-linux/srv-test-2/nextcloud-sync.nix index b13d05b..131985c 100644 --- a/systems/x86_64-linux/srv-test-2/nextcloud-sync.nix +++ b/systems/x86_64-linux/srv-test-2/nextcloud-sync.nix @@ -1,5 +1,6 @@ { config, + lib, pkgs, ... }: let @@ -36,4 +37,23 @@ in { IdentityFile /etc/ssh/ssh_host_ed25519_key IdentitiesOnly yes ''; + + systemd.services.nextcloud-sync = { + description = "Syncronizes the NextCloud installation on srv-prod-2 with the installation on this server"; + after = ["network.target"]; + wants = ["network.target"]; + serviceConfig = { + ExecStart = lib.getExe nextcloud-sync; + Type = "oneshot"; + }; + }; + + systemd.timers.nextcloud-sync = { + description = "Timer to run nextcloud-sync service nightly"; + timerConfig = { + OnCalendar = "daily"; + Persistent = true; + }; + wantedBy = ["timer.target"]; + }; }