{ config, pkgs, ... }: { systemd.user.services.sync-videos = { Unit = { Description = "synchronize my videos to the NAS"; Documentation = "man:rsync(1)"; ConditionFileIsExecutable = "${pkgs.rsync}/bin/rsync"; }; Service = { Type = "oneshot"; ExecStart = "${pkgs.rsync}/bin/rysnc -avz -t %h/media/videos/ nas.home:/data/videos/incoming"; }; }; systemd.user.timers.sync-videos = { Unit = { Description = "synchronize my videos to the NAS"; Documentation = "man:rsync(1)"; }; Timer = { OnBootSec = "120m"; OnUnitActiveSec = "1d"; RandomizedDelaySec = "1800"; Persistent = true; }; Install = { WantedBy = [ "timers.target" ]; }; }; }