From 769e07ef8f4cf7b1ec3b96ef015abec9bc6b1e2a Mon Sep 17 00:00:00 2001 From: kfiz Date: Sat, 28 Mar 2026 23:55:35 +0100 Subject: [PATCH] aerc: add notmuch integration Currently enabling aerc in accounts.email.accounts. doesn't handle existing configs where accounts.email.accounts..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. --- modules/programs/aerc/accounts.nix | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/modules/programs/aerc/accounts.nix b/modules/programs/aerc/accounts.nix index 050352ee..efe34326 100644 --- a/modules/programs/aerc/accounts.nix +++ b/modules/programs/aerc/accounts.nix @@ -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