From 4ab45f29210d40f13d964ec4ae6fcf47d81f0768 Mon Sep 17 00:00:00 2001 From: Julien Malka Date: Sat, 26 Apr 2025 12:50:53 +0200 Subject: [PATCH] chore: add expunging of mails --- home-manager-modules/mails/default.nix | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/home-manager-modules/mails/default.nix b/home-manager-modules/mails/default.nix index 56f02b4..0a1a8e0 100644 --- a/home-manager-modules/mails/default.nix +++ b/home-manager-modules/mails/default.nix @@ -46,6 +46,7 @@ with lib; mbsync = { enable = true; create = "maildir"; + expunge = "both"; extraConfig.channel = { "CopyArrivalDate" = "yes"; }; @@ -67,6 +68,7 @@ with lib; mbsync = { enable = true; create = "maildir"; + expunge = "both"; extraConfig.channel = { "CopyArrivalDate" = "yes"; }; @@ -89,6 +91,7 @@ with lib; mbsync = { enable = true; create = "maildir"; + expunge = "both"; extraConfig.channel = { "CopyArrivalDate" = "yes"; }; @@ -111,6 +114,7 @@ with lib; mbsync = { enable = true; create = "maildir"; + expunge = "both"; extraConfig.channel = { "CopyArrivalDate" = "yes"; }; @@ -138,6 +142,9 @@ with lib; programs.notmuch = { enable = lib.mkDefault true; new.tags = [ "new" ]; + hooks.preNew = lib.mkDefault '' + ${pkgs.notmuch-mailmover}/bin/notmuch-mailmover --config ${./mailmover.lua} + ''; hooks.postNew = lib.mkDefault '' ${pkgs.afew}/bin/afew --tag --new ''; @@ -149,13 +156,9 @@ with lib; [FolderNameFilter] maildir_separator = / folder_lowercases = true - folder_blacklist = Sent - [ArchiveSentMailsFilter] - sent_tag = sent [Filter.1] - query = tag:archive + query = tag:new tags = -new - [InboxFilter] ''; };