From ee66111ba1ff1bb5e74fd836aa883204e59b0310 Mon Sep 17 00:00:00 2001 From: Ben Sima Date: Wed, 14 Nov 2018 14:42:20 -0800 Subject: Split into os-specific files --- email.nix | 81 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 81 insertions(+) create mode 100644 email.nix (limited to 'email.nix') diff --git a/email.nix b/email.nix new file mode 100644 index 0000000..ad2f7d4 --- /dev/null +++ b/email.nix @@ -0,0 +1,81 @@ +{ pkgs, ... }: + +let + homedir = builtins.getEnv "HOME"; +in +{ + accounts = { + email = { + maildirBasePath = "${homedir}/Mail"; + accounts = { + "ben@bsima.me" = { + primary = true; + realName = "Ben Sima"; + address = "ben@bsima.me"; + folders = { + inbox = "INBOX"; + }; + imap = { + host = "mail.bsima.me"; + port = 993; + }; + smtp = { + host = "mail.bsima.me"; + port = 587; + }; + userName = "ben@bsima.me"; + mbsync = { + enable = true; + create = "both"; + expunge = "none"; + }; + notmuch.enable = true; + msmtp.enable = false; + passwordCommand = "pass bnet/helium/mail/ben"; + }; + }; + }; + }; + + programs = { + notmuch = { + enable = true; + new.tags = [ "unread" "inbox" ]; + hooks = { + preNew = '' + msmtp-queue -r + mbsync --all + ''; + postNew = '' + notmuch tag -inbox +haskell -- to:haskell-cafe@haskell.org + notmuch tag -inbox +clojure -- to:clojure@googlegroups.com + notmuch tag -inbox +ai -- to:scikit-learn@python.org OR to:tensorflow.org + notmuch tag -inbox +bitcoin -- to:bitcoin-dev@lists.linuxfoundation.org OR to:bitcoin-discuss@lists.linuxfoundation.org + notmuch tag -inbox +diybio -- to:diybio@googlegroups.com + notmuch tag -inbox +meetups -- from:meetup.com + afew -tn + ''; + + }; + extraConfig = { + search = { + exclude_tags = "deleted;spam;"; + }; + }; + }; + + afew = { + enable = true; + extraConfig = builtins.readFile ./afew.ini; + }; + + mbsync = { + enable = true; + }; + + msmtp = { + enable = false; + extraConfig = builtins.readFile ./msmtprc; + }; + }; +} -- cgit v1.2.3