summaryrefslogtreecommitdiff
path: root/profiles/email/mailsync.nix
diff options
context:
space:
mode:
Diffstat (limited to 'profiles/email/mailsync.nix')
-rw-r--r--profiles/email/mailsync.nix34
1 files changed, 34 insertions, 0 deletions
diff --git a/profiles/email/mailsync.nix b/profiles/email/mailsync.nix
new file mode 100644
index 0000000..3fcb0c5
--- /dev/null
+++ b/profiles/email/mailsync.nix
@@ -0,0 +1,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";
+ };
+ };
+}