aerc: add notmuch integration

Currently enabling aerc in accounts.email.accounts.<account> doesn't handle existing configs where accounts.email.accounts.<account>.notmuch.enable is set to true. This pr proposes to automatically set notmuch as backend for aerc if this is the case, see rjarry/aerc@master/doc/aerc-notmuch.5.scd.

For set-ups where accounts.email.notmuch.enable has been enabled this was previously ignored, so this is probably a breaking change for these configs, but from running this set up during the last weeks I would consider the upside of better search and filtering performance as significantly larger than the minor changes in query handling as noted here rjarry/aerc@master/doc/aerc-notmuch.5.scd#usage.
This commit is contained in:
kfiz 2026-03-28 23:55:35 +01:00 committed by GitHub
parent 4a8e31396a
commit 769e07ef8f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -175,6 +175,11 @@ in
"";
mkConfig = {
notmuch = cfg: {
source = "notmuch://${config.accounts.email.maildirBasePath}";
maildir-store = "${config.accounts.email.maildirBasePath}";
maildir-account-path = "${cfg.maildir.path}";
};
maildir = cfg: {
source = "maildir://${config.accounts.email.maildirBasePath}/${cfg.maildir.path}";
};
@ -260,7 +265,9 @@ in
sourceCfg =
account:
if
if account.notmuch.enable then
mkConfig.notmuch account
else if
account.mbsync.enable && account.mbsync.flatten == null && account.mbsync.subFolders == "Maildir++"
then
mkConfig.maildirpp account