summaryrefslogtreecommitdiffstats
path: root/lass/2configs/mail.nix
diff options
context:
space:
mode:
Diffstat (limited to 'lass/2configs/mail.nix')
-rw-r--r--lass/2configs/mail.nix34
1 files changed, 18 insertions, 16 deletions
diff --git a/lass/2configs/mail.nix b/lass/2configs/mail.nix
index 962efaf3f..7c58e8c5f 100644
--- a/lass/2configs/mail.nix
+++ b/lass/2configs/mail.nix
@@ -1,3 +1,4 @@
+with import <stockholm/lib>;
{ pkgs, ... }:
let
@@ -19,6 +20,14 @@ let
text/html; ${pkgs.elinks}/bin/elinks -dump ; copiousoutput;
'';
+ mailboxes = {
+ wireguard = [ "wireguard@lists.zx2c4" ];
+ c-base = [ "c-base.org" ];
+ security = [ "seclists.org" "security" "bugtraq" ];
+ nix-devel = [ "nix-devel@googlegroups.com" ];
+ shack = [ "shackspace.de" ];
+ };
+
muttrc = pkgs.writeText "muttrc" ''
# gpg
source ${pkgs.neomutt}/share/doc/mutt/samples/gpg.rc
@@ -72,22 +81,15 @@ let
''} %r |"
virtual-mailboxes \
- "Unread" "notmuch://?query=tag:unread"\
- "INBOX" "notmuch://?query=tag:inbox \
- and NOT to:nix-devel\
- and NOT to:shackspace\
- and NOT to:security\
- and NOT to:c-base" \
- "shack" "notmuch://?query=to:shackspace"\
- "c-base" "notmuch://?query=to:c-base"\
- "security" "notmuch://?query=to:securityfocus or from:security-alert@hpe.com"\
- "nix" "notmuch://?query=to:nix-devel"\
- "radio" "notmuch://?query=to:radio or tag:radio"\
- "TODO" "notmuch://?query=tag:TODO"\
- "Starred" "notmuch://?query=tag:*"\
- "Archive" "notmuch://?query=tag:archive"\
- "Sent" "notmuch://?query=tag:sent"\
- "Junk" "notmuch://?query=tag:junk"
+ "Unread" "notmuch://?query=tag:unread"\
+ "INBOX" "notmuch://?query=tag:inbox ${concatMapStringsSep " " (f: "and NOT to:${f}") (flatten (attrValues mailboxes))}"\
+ ${concatMapStringsSep "\n" (i: ''${" "}"${i.name}" "notmuch://?query=${concatMapStringsSep " or " (f: "to:${f}") i.value}"\'') (mapAttrsToList nameValuePair mailboxes)}
+ "BOX" "notmuch://?query=${concatMapStringsSep " and " (f: "NOT to:${f}") (flatten (attrValues mailboxes))}"\
+ "TODO" "notmuch://?query=tag:TODO"\
+ "Starred" "notmuch://?query=tag:*"\
+ "Archive" "notmuch://?query=tag:archive"\
+ "Sent" "notmuch://?query=tag:sent"\
+ "Junk" "notmuch://?query=tag:junk"
tag-transforms "junk" "k" \
"unread" "u" \