summaryrefslogtreecommitdiff
path: root/profiles/email/mailsync.nix
blob: 42620d6eb4675107dce123ec5f722ba9db79c84e (plain)
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
31
32
33
34
{
  config,
  ...
}: {
  hm = {
    programs.mbsync = {
      enable = true;
    };
    systemd.user.timers.mailsync = {
      Unit = {
        Description = "daemon that syncs mail";
      };
      Timer = {
        OnBootSec = "5m";
        OnUnitActiveSec = "5m";
        Unit = "mailsync.service";
      };
      Install = {
        WantedBy = [ "timers.target" ];
      };
    };
    systemd.user.services.mailsync = {
      Unit = {
        Description = "daemon that syncs mail";
      };
      Service = {
        Type = "oneshot";
        RemainAfterExit = "no";
        ExecSearchPath = "${config.my.home}/.local/bin:${config.hm.home.profileDirectory}/bin:/run/current-system/sw/bin";
        ExecStart = "mailsync";
      };
    };
  };
}