{ pkgs, config, ... }: {
  services.gitea.dump = {
    enable = true;
    interval = "2:45";
  };
  systemd.timers."gitea-clear-dump" = {
    wantedBy = [ "timers.target" ];
    timerConfig = {
      OnCalendar = "daily";
      Persistent = true;
      Unit = "gitea-clear-dump.service";
    };
  };

  systemd.services."gitea-clear-dump" = {
    script = ''
      ${pkgs.findutils}/bin/find /var/lib/gitea/dump -type f -ctime +5 -exec rm -f {} \;
    '';
    serviceConfig = {
      Type = "oneshot";
      User = config.services.gitea.user;
    };
  };
}
