#
# Taskwarrior automatic syncing.
#
{ pkgs, ... }:
{

  # Set up a timer to run sync every 5 minutes...
  systemd.timers."taskwarrior-sync" = {
    wantedBy = [ "timers.target" ];
    timerConfig = {
      OnBootSec = "5m";
      OnUnitActiveSec = "5m";
      Unit = "taskwarrior-sync.service";
    };
  };

  # ... which just runs the "task sync" task, if we can.
  systemd.services."taskwarrior-sync" = {
    script = "${pkgs.taskwarrior3}/bin/task sync";
    serviceConfig = {
      Type = "oneshot";
      User = "deprekated";
    };
  };

}
