mbsync works! mailcap for neomutt

This commit is contained in:
Anish L 2022-03-22 22:06:14 +10:00
parent dbd8163309
commit b7fdbe1804

View file

@ -7,22 +7,25 @@
services.mbsync = { services.mbsync = {
enable = true; enable = true;
frequency = "*:0/30"; frequency = "*:0/30";
postExec = "${pkgs.notmuch}/bin/notmuch new"; #postExec = "${pkgs.notmuch}/bin/notmuch new";
}; };
programs.mbsync.enable = true; programs.mbsync.enable = true;
programs.msmtp.enable = true; programs.msmtp.enable = true;
programs.notmuch = { programs.notmuch = {
enable = true; enable = true;
hooks = {
preNew = "mbsync --all";
};
}; };
home.file.".mailcap".text = ''
text/html; firefox %s
application/pdf; zathura %s
image/png; feh %s
image/jpeg; feh %s
'';
programs.neomutt = { programs.neomutt = {
enable = true; enable = true;
extraConfig = '' extraConfig = ''
# Shamelessly Stolen from https://gideonwolfe.com/posts/workflow/neomutt/intro/ # Shamelessly Stolen from https://gideonwolfe.com/posts/workflow/neomutt/intro/
# set editor to neovim # set editor to neovim
set editor = "nvim" set editor = "nvim +':set textwidth=0'"
#set virtual_spoolfile=yes #set virtual_spoolfile=yes
set folder="~/Mail/" set folder="~/Mail/"
@ -46,7 +49,7 @@
# Set preffered view modes # Set preffered view modes
auto_view text/html text/calendar application/ics # view html automatically auto_view text/html text/calendar application/ics # view html automatically
# alternative_order text/html text/plain text/enriched text/* alternative_order text/plain text/enriched text/html text/*
# main options # main options
#set envelope_from #set envelope_from
@ -106,7 +109,6 @@
set tilde set tilde
unset markers unset markers
#set mailcap_path = ~/.config/neomutt/mailcap
#set header_cache = "~/.cache/mutt" #set header_cache = "~/.cache/mutt"
#set message_cachedir = "~/.cache/mutt" #set message_cachedir = "~/.cache/mutt"
@ -265,8 +267,8 @@
onNotify = "${pkgs.isync}/bin/mbsync anish && ${pkgs.notmuch}/bin/notmuch index"; onNotify = "${pkgs.isync}/bin/mbsync anish && ${pkgs.notmuch}/bin/notmuch index";
onNotifyPost = { onNotifyPost = {
mail = "${pkgs.libnotify}/bin/notify-send -a mail 'email: new in %s'"; mail = "${pkgs.libnotify}/bin/notify-send -a mail 'email: new in %s'";
update = "${pkgs.libnotify}/bin/notify-send -a mail 'email: update %s'"; #update = "${pkgs.libnotify}/bin/notify-send -a mail 'email: update %s'";
expunge = "${pkgs.libnotify}/bin/notify-send -a mail 'email: expunge %s'"; #expunge = "${pkgs.libnotify}/bin/notify-send -a mail 'email: expunge %s'";
}; };
}; };
msmtp.enable = true; msmtp.enable = true;
@ -279,7 +281,7 @@
''; '';
showSignature = "append"; showSignature = "append";
}; };
passwordCommand = "cat /run/agenix/fastmail"; passwordCommand = "${pkgs.coreutils}/bin/cat /run/agenix/fastmail";
smtp = { smtp = {
host = "fastmail.com"; host = "fastmail.com";
}; };