summaryrefslogtreecommitdiff
path: root/modules/mail/default.nix
diff options
context:
space:
mode:
authorGrigory Shipunov2023-02-13 14:31:11 +0100
committerGrigory Shipunov2023-02-13 14:31:11 +0100
commit8b13219861f316ca4133a22f25069da50391f82f (patch)
tree61ecd81cc5479a3075cd30537511682ac5c1107c /modules/mail/default.nix
parent9d1c35311c01046df9d52afd66e598ae57e56509 (diff)
add service to flush the msmtp queue
Diffstat (limited to 'modules/mail/default.nix')
-rw-r--r--modules/mail/default.nix24
1 files changed, 23 insertions, 1 deletions
diff --git a/modules/mail/default.nix b/modules/mail/default.nix
index 4f77a8d..71b195f 100644
--- a/modules/mail/default.nix
+++ b/modules/mail/default.nix
@@ -8,7 +8,6 @@ in
msmtp
neomutt
notmuch
- pass
w3m
links2
];
@@ -81,6 +80,7 @@ in
systemd.user = {
+ # Service and timer to sync imap to local maildir
services.mbsync = {
enable = true;
after = [ "graphical.target" "network-online.target" ];
@@ -102,5 +102,27 @@ in
};
};
+ # service and timer to flush the msmtp queue
+ services.flush-msmtpq = {
+ enable = true;
+ after = [ "graphical.target" "network-online.target" ];
+ script = ''
+ ${pkgs.msmtp}/bin/msmtp-queue -r
+ '';
+ serviceConfig = {
+ Type = "oneshot";
+ };
+ };
+
+ timers.flush-msmtpq = {
+ enable = true;
+ wantedBy = [ "timers.target" ];
+ timerConfig = {
+ Unit = "flush-msmtpq.service";
+ OnBootSec = "11m";
+ OnUnitInactiveSec = "13m";
+ };
+ };
+
};
}