This repository has no description
914 B
41 lines
1{ config, pkgs, ... }:
2
3{
4 systemd.services.muchsync =
5 let
6 hosts = [
7 "coaxmetal.r"
8 "mors.r"
9 "green.r"
10 ];
11 in
12 {
13 description = "sync mails";
14 environment = {
15 NOTMUCH_CONFIG = config.environment.variables.NOTMUCH_CONFIG;
16 };
17 after = [ "network.target" ];
18
19 restartIfChanged = false;
20
21 path = [
22 pkgs.notmuch
23 pkgs.openssh
24 ];
25
26 startAt = "*:*"; # run every minute
27 serviceConfig = {
28 User = "lass";
29 Type = "oneshot";
30 ExecStart = pkgs.writeDash "sync-mails" ''
31 set -euf
32
33 /run/current-system/sw/bin/nm-tag-init 2>/dev/null
34 ${concatMapStringsSep "\n" (host: ''
35 echo syncing ${host}:
36 ${pkgs.muchsync}/bin/muchsync -s 'ssh -CTaxq -o ConnectTimeout=4' --nonew lass@${host} || :
37 '') hosts}
38 '';
39 };
40 };
41}