From 6163eb0396d9a7aafb18386789408f129974c9da Mon Sep 17 00:00:00 2001 From: kiskaadee Date: Thu, 26 Nov 2026 21:41:53 -0500 Subject: [PATCH] feat(home): add systemd user timer for corazoncp-drive sync - Add systemd.user.services.corazoncp-drive-sync running drive/sync-drive.sh with explicit PATH (rclone, git, openssh, libnotify, util-linux, findutils, coreutils) - Add systemd.user.timers.corazoncp-drive-sync polling every 15m (Persistent=true) so syncs survive reboots and catch up after sleep --- home/dev.nix | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/home/dev.nix b/home/dev.nix index f17e370..c00ed72 100644 --- a/home/dev.nix +++ b/home/dev.nix @@ -227,4 +227,34 @@ in sops # Mozilla SOPS CLI age # File encryption tool ]; + + # Background two-way sync for corazoncp shared Google Drive repository + systemd.user.services.corazoncp-drive-sync = { + Unit = { + Description = "Two-way sync between corazoncp/drive and Google Drive"; + After = [ "network-online.target" "graphical-session.target" ]; + Wants = [ "network-online.target" ]; + }; + Service = { + Type = "oneshot"; + ExecStart = "${pkgs.bash}/bin/bash /home/kiskaadee/Projects/active/corazoncp/drive/sync-drive.sh"; + Environment = [ + "PATH=${pkgs.lib.makeBinPath [ pkgs.rclone pkgs.git pkgs.openssh pkgs.libnotify pkgs.util-linux pkgs.findutils pkgs.coreutils ]}" + ]; + }; + }; + + systemd.user.timers.corazoncp-drive-sync = { + Unit = { + Description = "Poll corazoncp shared Google Drive every 15 minutes"; + }; + Timer = { + OnBootSec = "2m"; + OnUnitActiveSec = "15m"; + Persistent = true; + }; + Install = { + WantedBy = [ "timers.target" ]; + }; + }; }