Add neomutt config

This commit is contained in:
Charlotte 🦝 Delenk 2023-01-02 17:40:45 +01:00
parent 902c73eb63
commit 2af5a24726
Signed by: darkkirb
GPG key ID: AB2BD8DAF2E37122
4 changed files with 160 additions and 4 deletions

View file

@ -5,6 +5,7 @@ desktop: {pkgs, ...}: {
../programs/tmux.nix
../programs/ssh.nix
../programs/taskwarrior.nix
../programs/mail.nix
];
programs = {
zsh = {

View file

@ -28,7 +28,6 @@
../programs/kicad.nix
../programs/vscode
../programs/misc.nix
../programs/mail.nix
../programs/zk.nix
]
else []

View file

@ -1,3 +1,123 @@
{pkgs, ...}: {
home.packages = with pkgs; [thunderbird];
{pkgs, ...}: let
mailcap = pkgs.writeText "mailcap" ''
text/html; ${pkgs.w3m}/bin/w3m -I %{charset} -T text/html; copiousoutput;
image/*; ${pkgs.imv}/bin/imv %s
'';
in {
accounts.email = {
accounts = {
lotte = {
address = "lotte@chir.rs";
aliases = ["darkkirb@darkkirb.de"];
gpg = {
encryptByDefault = true;
key = "0xB4E3D4801C49EC5E";
signByDefault = true;
};
imap.host = "mail.chir.rs";
imapnotify = {
enable = true;
boxes = ["Inbox"];
onNotify = "${pkgs.systemd}/bin/start --user mbsync.service";
};
mbsync = {
enable = true;
create = "both";
expunge = "both";
remove = "both";
};
msmtp.enable = true;
neomutt.enable = true;
notmuch.enable = true;
passwordCommand = "${pkgs.coreutils}/bin/cat /run/secrets/email/lotte@chir.rs";
primary = true;
realName = "Charlotte 🦝 Delenk";
signature.text = ''
Charlotte
@charlotte@akko.chir.rs https://darkkirb.de 0xB4E3D4801C49EC5E
'';
smtp.host = "mail.chir.rs";
userName = "lotte@chir.rs";
};
};
};
services = {
imapnotify.enable = true;
mbsync = {
enable = true;
frequency = "*:0/15";
postExec = "${pkgs.notmuch}/bin/notmuch new";
};
};
programs = {
afew = {
enable = true;
extraConfig = ''
[ArchiveSentMailsFilter]
[DMARCReportInspectionFilter]
[HeaderMatchingFilter.1]
header = X-Spam
pattern = Yes
tags = +spam
[KillThreadsFilter]
[ListMailsFilter]
[Filter.0]
query = tag:new
tags = +inbox;+unread;-new
'';
};
mbsync.enable = true;
msmtp.enable = true;
neomutt = {
enable = true;
binds = [
{
key = "\\CA";
action = "sidebar-next";
map = ["index" "pager"];
}
{
key = "\\CL";
action = "sidebar-prev";
map = ["index" "pager"];
}
{
key = "\\CP";
action = "sidebar-open";
map = ["index" "pager"];
}
{
key = "<Enter>";
action = "display-message";
map = ["index"];
}
{
key = "\\CV";
action = "display-message";
map = ["index"];
}
];
extraConfig = ''
virtual-mailboxes "To Do" "notmuch://?query=tag:todo"
virtual-mailboxes "To Read" "notmuch://?query=tag:toread"
virtual-mailboxes "Blocked" "notmuch://?query=tag:blocked"
virtual-mailboxes "Archive" "notmuch://?query=tag:archive"
macro index,pager A "<modify-labels-then-hide>+archive -unread -inbox\n"
bind index,pager y modify-labels
set mailcap_path = ${mailcap}
set send_charset="utf-8"
set edit_headers=yes
set use_8bit_mime=yes
'';
sidebar.enable = true;
};
notmuch = {
enable = true;
hooks.postNew = ''
${pkgs.afew}/bin/afew --tag --new
'';
};
};
}

View file

@ -400,7 +400,7 @@ in {
# --------------
"ui.background" = {
fg = "text";
bg = "base";
bg = {};
};
"ui.linenr" = {fg = "surface1";};
@ -537,4 +537,40 @@ in {
};
};
};
programs.neomutt.extraConfig = ''
color normal default default # Text is "Text"
color index color2 default ~N # New Messages are Green
color index color1 default ~F # Flagged messages are Red
color index color13 default ~T # Tagged Messages are Red
color index color1 default ~D # Messages to delete are Red
color attachment color5 default # Attachments are Pink
color signature color8 default # Signatures are Surface 2
color search color4 default # Highlighted results are Blue
color indicator default color8 # currently highlighted message Surface 2=Background Text=Foreground
color error color1 default # error messages are Red
color status color15 default # status line "Subtext 0"
color tree color15 default # thread tree arrows Subtext 0
color tilde color15 default # blank line padding Subtext 0
color hdrdefault color13 default # default headers Pink
color header color13 default "^From:"
color header color13 default "^Subject:"
color quoted color15 default # Subtext 0
color quoted1 color7 default # Subtext 1
color quoted2 color8 default # Surface 2
color quoted3 color0 default # Surface 1
color quoted4 color0 default
color quoted5 color0 default
color body color2 default [\-\.+_a-zA-Z0-9]+@[\-\.a-zA-Z0-9]+ # email addresses Green
color body color2 default (https?|ftp)://[\-\.,/%~_:?&=\#a-zA-Z0-9]+ # URLs Green
color body color4 default (^|[[:space:]])\\*[^[:space:]]+\\*([[:space:]]|$) # *bold* text Blue
color body color4 default (^|[[:space:]])_[^[:space:]]+_([[:space:]]|$) # _underlined_ text Blue
color body color4 default (^|[[:space:]])/[^[:space:]]+/([[:space:]]|$) # /italic/ text Blue
color sidebar_flagged color1 default # Mailboxes with flagged mails are Red
color sidebar_new color10 default # Mailboxes with new mail are Green
'';
}