summaryrefslogtreecommitdiffstats
path: root/lass/2configs/mail.nix
diff options
context:
space:
mode:
authorlassulus <lassulus@lassul.us>2018-02-25 23:32:59 +0100
committerlassulus <lassulus@lassul.us>2018-02-25 23:32:59 +0100
commit2d6f67e5358b1c60b7e778e3844f84434c0140e0 (patch)
treec1ac81e742c82c698813e42f0521293b931b7449 /lass/2configs/mail.nix
parent23a7012581e11e73f1dd9ceb5683c7384836a318 (diff)
l mail: use tags for mailboxes
Diffstat (limited to 'lass/2configs/mail.nix')
-rw-r--r--lass/2configs/mail.nix11
1 files changed, 8 insertions, 3 deletions
diff --git a/lass/2configs/mail.nix b/lass/2configs/mail.nix
index e83201cd8..2cf20b32c 100644
--- a/lass/2configs/mail.nix
+++ b/lass/2configs/mail.nix
@@ -28,6 +28,11 @@ let
shack = [ "to:shackspace.de" ];
};
+ tag-mails = pkgs.writeDashBin "nm-init-tag" ''
+ ${pkgs.notmuch}/bin/notmuch new
+ ${concatMapStringsSep "\n" (i: ''${pkgs.notmuch}/bin/notmuch tag -inbox +${i.name} -- tag:inbox ${concatMapStringsSep " or " (f: "${f}") i.value}'') (mapAttrsToList nameValuePair mailboxes)}
+ '';
+
muttrc = pkgs.writeText "muttrc" ''
# gpg
source ${pkgs.neomutt}/share/doc/mutt/samples/gpg.rc
@@ -80,10 +85,9 @@ let
# V
''} %r |"
- virtual-mailboxes "INBOX" "notmuch://?query=tag:inbox ${concatMapStringsSep " " (f: "and NOT ${f}") (flatten (attrValues mailboxes))}"
+ virtual-mailboxes "INBOX" "notmuch://?query=tag:inbox"
virtual-mailboxes "Unread" "notmuch://?query=tag:unread"
- ${concatMapStringsSep "\n" (i: ''${" "}virtual-mailboxes "${i.name}" "notmuch://?query=${concatMapStringsSep " or " (f: "${f}") i.value}"'') (mapAttrsToList nameValuePair mailboxes)}
- virtual-mailboxes "BOX" "notmuch://?query=${concatMapStringsSep " and " (f: "NOT ${f}") (flatten (attrValues mailboxes))}"
+ ${concatMapStringsSep "\n" (i: ''${" "}virtual-mailboxes "${i.name}" "notmuch://?query=tag:${i.name}"'') (mapAttrsToList nameValuePair mailboxes)}
virtual-mailboxes "TODO" "notmuch://?query=tag:TODO"
virtual-mailboxes "Starred" "notmuch://?query=tag:*"
virtual-mailboxes "Archive" "notmuch://?query=tag:archive"
@@ -163,5 +167,6 @@ in {
mutt
pkgs.much
pkgs.notmuch
+ tag-mails
];
}