summaryrefslogtreecommitdiff
path: root/profiles/email/mailsync.nix
blob: 3fcb0c5ef9f66a82e997ebd54cd25845b652f88f (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
{
  inputs,
  config,
  pkgs,
  ...
}: {
  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.home.profileDirectory}/bin:/run/current-system/sw/bin";
          ExecStart = "${pkgs.coreutils}/bin/env mailsync";
      };
  };
}