From 278ffa2b05d92e4eb3e16ff10fe8307cb8f91144 Mon Sep 17 00:00:00 2001 From: Aspen Smith Date: Sun, 29 Sep 2024 10:46:42 -0400 Subject: feat(aspen/system): Setup a systemd timer to sync the depot public inbox Change-Id: Iaeae18af25b00b04bd805dabb320c218cb21fd8f Reviewed-on: https://cl.tvl.fyi/c/depot/+/12545 Tested-by: BuildkiteCI Autosubmit: aspen Reviewed-by: aspen --- users/aspen/system/home/machines/lusca.nix | 7 +++---- users/aspen/system/home/modules/depot-inbox.nix | 26 +++++++++++++++++++++++++ 2 files changed, 29 insertions(+), 4 deletions(-) create mode 100644 users/aspen/system/home/modules/depot-inbox.nix (limited to 'users/aspen/system/home') diff --git a/users/aspen/system/home/machines/lusca.nix b/users/aspen/system/home/machines/lusca.nix index fc5f606639d6..d791b0ea9ded 100644 --- a/users/aspen/system/home/machines/lusca.nix +++ b/users/aspen/system/home/machines/lusca.nix @@ -1,14 +1,13 @@ { pkgs, lib, config, ... }: -let - inherit (builtins) pathExists; -in -{ +let inherit (builtins) pathExists; +in { imports = [ ../platforms/linux.nix ../modules/common.nix ../modules/email.nix + ../modules/depot-inbox.nix ../modules/desktop.nix ] ++ (lib.optional (pathExists ../modules/private.nix) ../modules/private.nix); diff --git a/users/aspen/system/home/modules/depot-inbox.nix b/users/aspen/system/home/modules/depot-inbox.nix new file mode 100644 index 000000000000..0694e6db2855 --- /dev/null +++ b/users/aspen/system/home/modules/depot-inbox.nix @@ -0,0 +1,26 @@ +{ config, lib, pkgs, ... }: + +let + depot = config.lib.depot; +in + +{ + systemd.user = { + services.sync-depot-public-inbox = { + Service.ExecStart = pkgs.writeShellScript "sync-depot-public-inbox" '' + ${depot.tools.fetch-depot-inbox}/bin/fetch-depot-inbox \ + /home/aspen/mail/tvl/ + ${pkgs.notmuch}/bin/notmuch new + ''; + }; + + timers.sync-depot-public-inbox = { + Unit.Description = "Sync the depot public inbox"; + Timer = { + OnCalendar = "*:*"; + Unit = "sync-depot-public-inbox.service"; + }; + Install.WantedBy = [ "timers.target" ]; + }; + }; +} -- cgit 1.4.1