diff --git a/flake.lock b/flake.lock index 3176169..114cf11 100644 --- a/flake.lock +++ b/flake.lock @@ -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" diff --git a/modules/home-manager/accounts/email/default.nix b/modules/home-manager/accounts/email/default.nix index 11b7bcc..af9d1b1 100644 --- a/modules/home-manager/accounts/email/default.nix +++ b/modules/home-manager/accounts/email/default.nix @@ -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