diff --git a/ops/nixos/lib/twitternuke.nix b/ops/nixos/lib/twitternuke.nix new file mode 100644 index 0000000000..92ecd0a52c --- /dev/null +++ b/ops/nixos/lib/twitternuke.nix @@ -0,0 +1,24 @@ +# SPDX-FileCopyrightText: 2020 Luke Granger-Brown +# +# 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; + }; + }; + }; +} diff --git a/ops/nixos/totoro/default.nix b/ops/nixos/totoro/default.nix index 493ff99e4c..de015401bf 100644 --- a/ops/nixos/totoro/default.nix +++ b/ops/nixos/totoro/default.nix @@ -6,8 +6,12 @@ let inherit (depot.ops) secrets; in { - imports = - [ ../../../third_party/nixpkgs/nixos/modules/installer/scan/not-detected.nix ../lib/client.nix ../lib/whitby-distributed.nix ]; + imports = [ + ../../../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.kernelModules = lib.mkAfter [ "kvm-intel" ];