]> Git — Sourcephile - julm/julm-nix.git/blob - homes/julm/mutt.nix
julm: guard configs behind enable flags
[julm/julm-nix.git] / homes / julm / mutt.nix
1 { pkgs, lib, config, ... }:
2 {
3 config = lib.mkIf config.programs.neomutt.enable {
4 xdg.configFile."mutt/mailcap".text = ''
5 application/pdf; evince %s; test=test -n "$DISPLAY";
6 image/vnd.djvu; djview4 %s; test=test -n "$DISPLAY";
7 image/*; gthumb %s; test=test -n "$DISPLAY";
8 text/html; firefox %s; test=test -n "$DISPLAY"; edit=firefox %s;
9 '';
10 programs.neomutt.extraConfig = ''
11 unmailboxes *
12 set header_cache = "${config.xdg.cacheHome}/mutt/headers"
13 set mailcap_path = "${config.xdg.configHome}/mutt/mailcap"
14 set message_cachedir = "${config.xdg.cacheHome}/mutt/messages"
15 set news_cache_dir = '${config.xdg.cacheHome}/mutt/news'
16 set tmpdir = "${config.xdg.cacheHome}/mutt/tmp"
17 set newsrc = '${config.xdg.configHome}/mutt/newsrc.%s'
18 ${builtins.readFile mutt/muttrc}
19 macro index,pager H ":set auto_tag=yes\n:unset wait_key\n<pipe-entry>${pkgs.procmail}/bin/formail -ds | rspamc learn_ham\n:set wait_key\n" "Flag as HAM"
20 macro index,pager S "<pipe-entry>${pkgs.procmail}/bin/formail -ds | rspamc symbols\n<enter-command>set wait_key\n" "Tests if it is SPAM"
21 macro index,pager s ":set confirmappend=no delete=yes auto_tag=yes\n:unset wait_key\n<pipe-entry>${pkgs.procmail}/bin/formail -ds | rspamc learn_spam\n:set wait_key\n<save-message>=.Pourriel/\n<sync-mailbox>:set confirmappend=yes delete=ask-yes\n" "Flag as SPAM"
22
23 account-hook (autogeree.net) 'set certificate_file = ${mutt/autogeree.net/certificate_file.pem}'
24 account-hook (sourcephile.fr) 'set certificate_file = ${mutt/sourcephile.fr/certificate_file.pem}'
25
26 #source ${mutt/sourcephile.fr/julm.imap.conf}
27 #source ${mutt/autogeree.net/julm.imap.conf}
28 #set nm_default_uri = imaps://julm@sourcephile.fr@mail.sourcephile.fr:993/INBOX
29 #set spoolfile = imaps://julm@sourcephile.fr@mail.sourcephile.fr:993/
30
31 folder-hook (/autogeree.net/) 'source ${mutt/autogeree.net/julm.maildir.conf}'
32 source ${mutt/autogeree.net/julm.maildir.conf}
33 mailboxes `find -P ~/mail/autogeree.net/mail/ -type d -name new -printf "\"%h\" "`
34
35 folder-hook (/sourcephile.fr/) 'source ${mutt/sourcephile.fr/julm.maildir.conf}'
36 source ${mutt/sourcephile.fr/julm.maildir.conf}
37 mailboxes `find -P ~/mail/sourcephile.fr/mail/ -type d -name new -printf "\"%h\" "`
38
39 folder-hook (news.sourcephile.fr) 'source ${mutt/sourcephile.fr/julm.maildir.conf}; set record = =Envoyés'
40 source ${mutt/sourcephile.fr/mails.nntp.conf}
41 source ${mutt/sourcephile.fr/mails.imap.conf}
42 '';
43 };
44 }