summaryrefslogtreecommitdiffstats
path: root/lass/2configs/mail.nix
diff options
context:
space:
mode:
authorlassulus <lassulus@lassul.us>2018-01-23 23:41:16 +0100
committerlassulus <lassulus@lassul.us>2018-01-23 23:41:16 +0100
commit22c6aff64698eec5231a9c43b4fb3642d2b97f97 (patch)
treea46fd2d2da04efa90f5d541e4728f1ef8aa4840d /lass/2configs/mail.nix
parent7368b6a9dace5de4a798100066b3583faabb6f7b (diff)
l mail: use attrSets
Diffstat (limited to 'lass/2configs/mail.nix')
-rw-r--r--lass/2configs/mail.nix20
1 files changed, 10 insertions, 10 deletions
diff --git a/lass/2configs/mail.nix b/lass/2configs/mail.nix
index a26f3fcbb..7c58e8c5f 100644
--- a/lass/2configs/mail.nix
+++ b/lass/2configs/mail.nix
@@ -20,13 +20,13 @@ let
text/html; ${pkgs.elinks}/bin/elinks -dump ; copiousoutput;
'';
- inboxes = [
- { l = "wireguard"; q = [ "wireguard@lists.zx2c4" ]; }
- { l = "c-base"; q = [ "c-base.org" ]; }
- { l = "security"; q = [ "seclists.org" "security" "bugtraq" ]; }
- { l = "nix-devel"; q = [ "nix-devel@googlegroups.com" ]; }
- { l = "shack"; q = [ "shackspace.de" ]; }
- ];
+ 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
@@ -82,9 +82,9 @@ let
virtual-mailboxes \
"Unread" "notmuch://?query=tag:unread"\
- "INBOX" "notmuch://?query=tag:inbox ${concatMapStringsSep " " (f: "and NOT to:${f}") (concatMap (l: l.q) inboxes)}"\
- ${concatMapStringsSep "\n" (i: ''${" "}"${i.l}" "notmuch://?query=${concatMapStringsSep " or " (f: "to:${f}") i.q}"\'') inboxes}
- "BOX" "notmuch://?query=${concatMapStringsSep " and " (f: "NOT to:${f}") (concatMap (l: l.q) inboxes)}"\
+ "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"\