diff options
author | Ben Sima <ben@bsima.me> | 2018-11-07 12:15:57 -0800 |
---|---|---|
committer | Ben Sima <ben@bsima.me> | 2018-11-07 12:15:57 -0800 |
commit | 98d41aa9374b033f194f940ba3983babc29e5ef8 (patch) | |
tree | 52a3c978dbb9f5b0a1a40e3213b41d78e1a1dfb6 /home.nix | |
parent | 1e90212416d21d0bad313e1903f97a950e10e3f5 (diff) |
Configure email
Diffstat (limited to 'home.nix')
-rw-r--r-- | home.nix | 97 |
1 files changed, 59 insertions, 38 deletions
@@ -5,35 +5,38 @@ let homedir = builtins.getEnv "HOME"; in { - # Waiting for the accounts feature to land in the 18.03 release branch... - # - #accounts = { - # email = { - # maildirBasePath = "$HOME/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; - # notmuch.enable = true; - # passwordCommand = "pass bnet/helium/mail/ben"; - # }; - # }; - # }; - #}; + 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"; + }; + }; + }; + }; home = { packages = import ./packages.nix { inherit pkgs; }; sessionVariables = { @@ -52,14 +55,6 @@ in source = ./mailcap; target = ".mailcap"; }; - msmtp = { - source = ./msmtprc; - target = ".msmtprc"; - }; - notmuch = { - source = ./notmuch; - target = ".notmuch-config"; - }; tmux = { source = ./tmux; target = ".tmux.conf"; @@ -149,6 +144,10 @@ in enable = true; defaultCacheTtl = 600; enableSshSupport = true; + extraConfig = '' + allow-emacs-pinentry + pinentry-program /home/ben/.nix-profile/bin/pinentry-tty + ''; }; }; @@ -271,6 +270,28 @@ in firefox = { enable = true; }; - }; + notmuch = { + enable = true; + new.tags = [ "unread" "inbox" ]; + hooks = { + preNew = "mbsync --all"; + postNew = builtins.readFile ./notmuch-hook.sh; + }; + extraConfig = { + search = { + exclude_tags = "deleted;spam;"; + }; + }; + }; + + mbsync = { + enable = true; + }; + + msmtp = { + enable = false; + extraConfig = builtins.readFile ./msmtprc; + }; + }; } |