aboutsummaryrefslogtreecommitdiff
path: root/users/fcuny/desktop/media/sync-videos.nix
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--users/fcuny/desktop/media/sync-videos.nix29
1 files changed, 29 insertions, 0 deletions
diff --git a/users/fcuny/desktop/media/sync-videos.nix b/users/fcuny/desktop/media/sync-videos.nix
new file mode 100644
index 0000000..ced319d
--- /dev/null
+++ b/users/fcuny/desktop/media/sync-videos.nix
@@ -0,0 +1,29 @@
+{ 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" ]; };
+ };
+}