feat(accounts/mail): implement afew filters management
This commit is contained in:
parent
4ba9224348
commit
f9ebf23688
2 changed files with 12 additions and 4 deletions
6
flake.lock
generated
6
flake.lock
generated
|
@ -61,10 +61,10 @@
|
|||
"nixpkgs": "nixpkgs"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1754265461,
|
||||
"narHash": "sha256-qVA40ypUxsQR+kpzgqrsS2JrdwS6CI7JQcvpLjc+nlg=",
|
||||
"lastModified": 1754351405,
|
||||
"narHash": "sha256-q7KxXc9P60DAf2iUNXF42tUGkZErd0n59JuFxUMimlo=",
|
||||
"ref": "main",
|
||||
"rev": "7ce0411fc0c480211951ef58b263c5eb72579681",
|
||||
"rev": "cc10d2bdfb86551b7781041a1583388370da82cc",
|
||||
"shallow": true,
|
||||
"type": "git",
|
||||
"url": "ssh://git@git.epha.se:24422/ephase/nix-private.git"
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue