# SPDX-FileCopyrightText: 2020 Luke Granger-Brown <depot@lukegb.com>
#
# SPDX-License-Identifier: Apache-2.0

{ pkgs, depot, lib, ... }:
{
  config = {
    systemd.services.twitternuke = {
      serviceConfig = {
        Type = "oneshot";
        ExecStart = "${depot.go.twitternuke}/bin/twitternuke --dryrun=false --tweets_from_api";
        EnvironmentFile = "/home/lukegb/twitternuke/environment.txt";
      };
    };
    systemd.timers.twitternuke = {
      wantedBy = [ "timers.target" ];
      timerConfig = {
        OnCalendar = "daily";
        AccuracySec = "1h";
        Persistent = true;
      };
    };
  };
}