totoro: add twitternuke timer

This commit is contained in:
Luke Granger-Brown 2021-01-06 21:29:33 +00:00
parent df2e3c3464
commit aba7285824
2 changed files with 30 additions and 2 deletions

View file

@ -0,0 +1,24 @@
# 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;
};
};
};
}

View file

@ -6,8 +6,12 @@
let let
inherit (depot.ops) secrets; inherit (depot.ops) secrets;
in { in {
imports = imports = [
[ ../../../third_party/nixpkgs/nixos/modules/installer/scan/not-detected.nix ../lib/client.nix ../lib/whitby-distributed.nix ]; ../../../third_party/nixpkgs/nixos/modules/installer/scan/not-detected.nix
../lib/client.nix
../lib/whitby-distributed.nix
../lib/twitternuke.nix
];
boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "nvme" "usb_storage" "usbhid" "sd_mod" ]; boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "nvme" "usb_storage" "usbhid" "sd_mod" ];
boot.kernelModules = lib.mkAfter [ "kvm-intel" ]; boot.kernelModules = lib.mkAfter [ "kvm-intel" ];