This commit is contained in:
Till 2026-02-27 21:41:24 +01:00
parent 8099faa9ae
commit 312d6d63ef
23 changed files with 122 additions and 297 deletions

View file

@ -46,9 +46,25 @@ let
};
};
mailcap_path = pkgs.writeText "neomutt_mailcap" ''
application/pdf; zathura %s
multipart; xdg-open %s
text/html; firefox %s; description=HTML Text; nametemplate=%s.html; needsterminal
text/html; w3m -v -F -T text/html -dump %s; copiousoutput
text; neomutt %s
application; xdg-open %s
image; xdg-open %s
video; xdg-open %s
audio; xdg-open %s
message; xdg-open %s
model; xdg-open %s
'';
in
{
programs.mu.enable = true;
accounts.email = {
maildirBasePath = "${config.xdg.dataHome}/mail";
accounts = {
@ -129,7 +145,7 @@ in
new.tags = [ "new" "unread" ];
hooks = {
preNew = ''
notmuch tag +draft -- folder:/\/Drafts\// not tag:draft
notmuch tag +draft -- 'folder:"/\/Drafts$/"'
mbsync --all
'';
postNew = ''
@ -159,7 +175,7 @@ in
settings = {
abort_noattach = "ask-yes";
abort_noattach_regex = "\"(attach|enclosed|anbei|anhängen|angehängt|anhang|anhänge|hängt an)\"";
# auto_edit = "yes";
auto_edit = "yes";
beep = "no";
confirm_append = "no";
crypt_auto_sign = "yes";
@ -171,34 +187,43 @@ in
forward_attachments = "yes";
forward_format = "\"Fwd: %s\"";
forward_quote = "yes";
help = "no";
include = "yes";
mail_check_stats = "yes";
mailcap_path = builtins.path { path = ./neomutt_mailcap; };
mailcap_path = "${ mailcap_path }";
mark_old = "no";
markers = "no";
mbox_type = "Maildir";
menu_scroll = "yes";
mime_type_query_command = "\"file -b --mime-type %s\"";
nm_record = "yes";
pager_context = "3";
pager_index_lines = "5";
pager_stop = "yes";
query_command= "\"khard email --parsable '%s'\"";
recall = "no";
resume_draft_files = "yes";
reverse_real_name = "no";
shell = "/bin/sh";
sleep_time = "0";
smart_wrap = "yes";
status_chars = "٪A";
tilde = "yes";
use_envelope_from = "yes";
virtual_spool_file = "yes";
wait_key = "no";
};
binds = [
{ key = "m"; map = [ "index" "pager" ]; action = "noop"; }
{ key = "k"; map = "pager"; action = "previous-entry"; }
{ key = "j"; map = "pager"; action = "next-entry"; }
{ key = "<return>"; map = "index"; action = "display-message"; }
{ key = "<space>"; map = "index"; action = "collapse-thread"; }
{ key = "<space>"; map = "index"; action = "entire-thread"; }
{ key = "gf"; map = [ "index" "pager" ]; action = "change-folder"; }
{ key = "P"; map = "compose"; action = "pgp-menu"; }
{ key = "<Tab>"; map = "editor"; action = "complete-query"; }
{ key = "a"; map = [ "index" "pager" ]; action = "group-reply"; }
{ key = "m"; map = [ "index" "pager" ]; action = "noop"; }
{ key = "P"; map = "compose"; action = "pgp-menu"; }
{ key = "p"; map = [ "compose" ]; action = "postpone-message"; }
];
macros = [
@ -227,6 +252,7 @@ in
{ key = "S"; map = [ "index" "pager" ]; action = "<pipe-message>ripmime -i - -d ~/tmp && rm ~/tmp/textfile*"; }
{ key = "gb"; map = [ "index" "pager" ]; action = "<pipe-message>urlscan<enter>"; }
{ key = "I"; map = [ "compose" ]; action = "<attach-file>`tmpfile=$(mktemp -u --suffix .png -t XXXXXXXXXXXX -p ~/tmp) && wl-paste -t image/png > \"$tmpfile\" && echo \"$tmpfile\"`<enter>"; }
{ key = "p"; map = [ "compose" ]; action = "<postpone-message>"; }
{ key = "c"; map = [ "index" "pager" ]; action = "<enter-command>set signature=$my_signature<enter><mail>"; }
{ key = "r"; map = [ "index" "pager" ]; action = "<enter-command>unset signature<enter><reply>"; }