blob: 1ec41d8e13c23924f6a93e345df6b173fa3c5b15 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
{ pkgs, config, ... }:
{
environment.systemPackages = with pkgs; [ isync ];
systemd.services.isync =
let
mbsyncrc = pkgs.writeText "mbsyncrc" (import ./mbsyncrc.nix {
maildir = "${config.users.users.qyliss.home}/mail";
});
in {
serviceConfig = {
Type = "oneshot";
User = "qyliss-mail";
ExecStart = ''
${pkgs.isync}/bin/mbsync -a -c ${mbsyncrc}
'';
};
};
systemd.timers.isync = {
timerConfig = {
Unit = "isync.service";
OnCalendar = "*:0/5";
Persistent = "true";
};
wantedBy = [ "multi-user.target" ];
};
}
|