l mail: use attrSets

This commit is contained in:
lassulus 2018-01-23 23:41:16 +01:00
parent 7368b6a9da
commit 22c6aff646

View File

@ -20,13 +20,13 @@ let
text/html; ${pkgs.elinks}/bin/elinks -dump ; copiousoutput; text/html; ${pkgs.elinks}/bin/elinks -dump ; copiousoutput;
''; '';
inboxes = [ mailboxes = {
{ l = "wireguard"; q = [ "wireguard@lists.zx2c4" ]; } wireguard = [ "wireguard@lists.zx2c4" ];
{ l = "c-base"; q = [ "c-base.org" ]; } c-base = [ "c-base.org" ];
{ l = "security"; q = [ "seclists.org" "security" "bugtraq" ]; } security = [ "seclists.org" "security" "bugtraq" ];
{ l = "nix-devel"; q = [ "nix-devel@googlegroups.com" ]; } nix-devel = [ "nix-devel@googlegroups.com" ];
{ l = "shack"; q = [ "shackspace.de" ]; } shack = [ "shackspace.de" ];
]; };
muttrc = pkgs.writeText "muttrc" '' muttrc = pkgs.writeText "muttrc" ''
# gpg # gpg
@ -82,9 +82,9 @@ let
virtual-mailboxes \ virtual-mailboxes \
"Unread" "notmuch://?query=tag:unread"\ "Unread" "notmuch://?query=tag:unread"\
"INBOX" "notmuch://?query=tag:inbox ${concatMapStringsSep " " (f: "and 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.l}" "notmuch://?query=${concatMapStringsSep " or " (f: "to:${f}") i.q}"\'') inboxes} ${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}") (concatMap (l: l.q) inboxes)}"\ "BOX" "notmuch://?query=${concatMapStringsSep " and " (f: "NOT to:${f}") (flatten (attrValues mailboxes))}"\
"TODO" "notmuch://?query=tag:TODO"\ "TODO" "notmuch://?query=tag:TODO"\
"Starred" "notmuch://?query=tag:*"\ "Starred" "notmuch://?query=tag:*"\
"Archive" "notmuch://?query=tag:archive"\ "Archive" "notmuch://?query=tag:archive"\