aboutsummaryrefslogblamecommitdiff
path: root/users/fcuny/desktop/media/sync-videos.nix
blob: ced319dcc4ae945bcdd5f0c8c87b9ab60830cd3e (plain) (tree)




























                                                                                                    
{ 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" ]; };
  };
}