summaryrefslogtreecommitdiff
path: root/lib/email.nix
diff options
context:
space:
mode:
Diffstat (limited to 'lib/email.nix')
-rw-r--r--lib/email.nix90
1 files changed, 53 insertions, 37 deletions
diff --git a/lib/email.nix b/lib/email.nix
index 05cfd7e..2867a2c 100644
--- a/lib/email.nix
+++ b/lib/email.nix
@@ -1,45 +1,55 @@
-{ pkgs, lib, ... }:
+{ pkgs, lib, config, ... }:
let
- gpgid = "D09299626FA78AF8";
- homedir = builtins.getEnv "HOME";
+ inherit (import ./const.nix) homedir gpgid;
+ common = {
+ alot.sendMailCommand = "${homedir}/bin/sendmail";
+ imap = {
+ host = "bensima.com";
+ port = 993;
+ };
+ smtp = {
+ host = "bensima.com";
+ port = 587;
+ tls = {
+ enable = true;
+ useStartTls = true;
+ };
+ };
+ gpg = {
+ key = gpgid;
+ signByDefault = true;
+ encryptByDefault = false;
+ };
+ mbsync = {
+ create = "both";
+ expunge = "both";
+ remove = "both";
+ extraConfig.channel = { MaxMessages = 1000; };
+ };
+ passwordCommand = "${pkgs.pass}/bin/pass ben@bensima.com";
+ msmtp.enable = true;
+ mu.enable = true;
+ };
in
{
accounts = {
email = {
maildirBasePath = "${homedir}/Mail";
accounts = {
- "ben@simatime.com" = {
+ "ben@bensima.com" = common // {
primary = true;
realName = "Ben Sima";
- address = "ben@bsima.me";
- userName = "ben@simatime.com";
- alot.sendMailCommand = "${homedir}/bin/sendmail";
- imap = {
- host = "simatime.com";
- port = 993;
- };
- smtp = {
- host = "simatime.com";
- port = 587;
- tls = {
- enable = true;
- useStartTls = true;
- };
- };
- gpg = {
- key = gpgid;
- signByDefault = true;
- encryptByDefault = false;
- };
- mbsync = {
- enable = true;
- create = "both";
- expunge = "none";
- };
- notmuch.enable = true;
- passwordCommand = "${pkgs.coreutils}/bin/cat ~/private/ben@simatime.com";
- msmtp.enable = true;
+ address = "ben@bensima.com";
+ userName = "ben@bensima.com";
+ mbsync.enable = true;
+ };
+
+ "dev@bensima.com" = common // {
+ realName = "Ben Sima";
+ address = "dev@bensima.com";
+ userName = "dev@bensima.com";
+ mbsync.enable = false;
};
};
};
@@ -47,7 +57,7 @@ in
programs = {
notmuch = {
- enable = true;
+ enable = false;
new.tags = [ "new" ];
maildir.synchronizeFlags = true;
hooks = {
@@ -65,7 +75,7 @@ in
};
afew = {
- enable = true;
+ enable = false;
extraConfig = builtins.readFile ./afew.ini;
};
@@ -76,12 +86,18 @@ in
'';
};
- mbsync = {
- enable = true;
- };
+ mbsync.enable = true;
msmtp = {
enable = true;
};
+
+ mu.enable = true;
+ };
+
+ services = {
+ mbsync.enable = false; # just update manually in emacs
+ mbsync.frequency = "hourly";
+ mbsync.postExec = "${config.programs.mu.package}/bin/mu index";
};
}