l: add missing muchsync.nix
This commit is contained in:
parent
fbec363f09
commit
d618f52cda
40
lass/2configs/muchsync.nix
Normal file
40
lass/2configs/muchsync.nix
Normal file
|
@ -0,0 +1,40 @@
|
|||
with (import <stockholm/lib>);
|
||||
{ config, pkgs, ... }:
|
||||
|
||||
{
|
||||
systemd.services.muchsync = let
|
||||
hosts = [
|
||||
"mors.r"
|
||||
"green.r"
|
||||
"blue.r"
|
||||
];
|
||||
in {
|
||||
description = "sync mails";
|
||||
environment = {
|
||||
NOTMUCH_CONFIG = config.environment.variables.NOTMUCH_CONFIG;
|
||||
};
|
||||
after = [ "network.target" ];
|
||||
|
||||
restartIfChanged = false;
|
||||
|
||||
path = [
|
||||
pkgs.notmuch
|
||||
pkgs.openssh
|
||||
];
|
||||
|
||||
startAt = "*:*"; # run every minute
|
||||
serviceConfig = {
|
||||
User = "lass";
|
||||
Type = "oneshot";
|
||||
ExecStart = pkgs.writeDash "sync-mails" ''
|
||||
set -euf
|
||||
|
||||
/run/current-system/sw/bin/nm-tag-init 2>/dev/null
|
||||
${concatMapStringsSep "\n" (host: ''
|
||||
echo syncing ${host}:
|
||||
${pkgs.muchsync}/bin/muchsync -s 'ssh -CTaxq -o ConnectTimeout=4' --nonew lass@${host} || :
|
||||
'') hosts}
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Reference in a new issue