feat(accounts/mail): implement afew filters management

This commit is contained in:
Yorick Barbanneau 2025-08-05 02:02:19 +02:00
parent 4ba9224348
commit f9ebf23688
2 changed files with 12 additions and 4 deletions

View file

@ -63,7 +63,14 @@ in
v.afew.mailMover
else {}
) cfg.accountConfigs);
in {
mailFilterRules = lib.flatten (
lib.attrsets.mapAttrsToList (
n: v:
if lib.hasAttrByPath ["afew" "filters"] v then
v.afew.filters
else []
) cfg.accountConfigs);
in {
enable = true;
extraConfig = ''
[FolderNameFilter]
@ -79,6 +86,7 @@ in
[ArchiveSentMailsFilter]
sent_tag = sent
[InboxFilter]
${lib.concatImapStrings (p: e: "\n\n[Filter.${toString p}]\n ${lib.concatStringsSep "\n" (lib.mapAttrsToList (n: v: "${n} = ${v}") e)}") mailFilterRules}
'';
};
programs.neomutt = let