MBSync, Notmuch and emacs-notmuch

This commit is contained in:
Andrea Ciceri 2022-04-13 12:13:40 +02:00
parent 94b40d62d2
commit f205170f72
No known key found for this signature in database
GPG key ID: A1FC89532D1C5654
3 changed files with 72 additions and 6 deletions

View file

@ -16,30 +16,71 @@ in
accounts.email.accounts = {
personal = {
realName = "Andrea Ciceri";
address = "andrea.ciceri@autistici.org";
primary = true;
flavor = "plain";
passwordCommand = "pass show autistici/password";
#gpg = {
# key = "";
# signByDefault = true;
#};
imap.host = "mail.autistici.org";
imap =
{
host = "mail.autistici.org";
port = 993;
tls.enable = true;
};
mbsync = {
enable = true;
create = "maildir";
};
msmtp.enable = true;
notmuch.enable = true;
primary = true;
realName = "Andrea Ciceri";
#signature = {
# text = ''
# '';
# showSignature = "append";
#};
passwordCommand = "pass show autistici/password";
smtp = {
host = "smtp.autistici.org";
port = 465;
tls.enable = true;
};
userName = "andrea.ciceri@autistici.org";
};
};
systemd.user =
let
description = "Download mailboxes with mbsync and update notmuch db";
in
{
services.mbsync-and-notmuch =
{
Unit = {
After = [ "network.target" ];
Description = description;
};
Service = {
Type = "simple";
ExecStart = ''${pkgs.isync}/bin/mbsync -Va && ${pkgs.notmuch}/bin/notmuch new'';
};
Install = {
WantedBy = [ "multi-user.target" ];
};
};
timers.mbsync-and-notmuch = {
Unit = {
Description = "Timer to \"${description}\"";
};
Timer = {
OnBootSec = "2m";
OnUnitInactiveSec = "5m";
};
Install = {
WantedBy = [ "timers.target" ];
};
};
};
}