-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathmail.nix
98 lines (94 loc) · 2.82 KB
/
mail.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
{ config, options, lib, pkgs, ... }:
with lib;
let
name = "Edmund Miller";
maildir = "/home/emiller/.mail";
email = "[email protected]";
protonmail = "[email protected]";
notmuchrc = "/home/emiller/.config/notmuch/notmuchrc";
in {
options.modules.shell.mail = {
enable = mkOption {
type = types.bool;
default = false;
};
};
config = mkIf config.modules.shell.mail.enable {
my = {
packages = with pkgs; [ unstable.mu isync ];
home = {
accounts.email = {
maildirBasePath = "${maildir}";
accounts = {
Gmail = {
address = "${email}";
userName = "${email}";
flavor = "gmail.com";
passwordCommand = "${pkgs.pass}/bin/pass Email/GmailApp";
primary = true;
# gpg.encryptByDefault = true;
mbsync = {
enable = true;
create = "both";
expunge = "both";
patterns = [ "*" "[Gmail]*" ]; # "[Gmail]/Sent Mail" ];
};
realName = "${name}";
msmtp.enable = true;
};
Eman = {
address = "[email protected]";
userName = "[email protected]";
flavor = "gmail.com";
passwordCommand = "${pkgs.pass}/bin/pass oldGmail";
mbsync = {
enable = true;
create = "both";
expunge = "both";
patterns = [ "*" "[Gmail]*" ]; # "[Gmail]/Sent Mail" ];
};
realName = "${name}";
};
UTD = {
address = "[email protected]";
userName = "[email protected]";
aliases = [ "[email protected]" ];
flavor = "plain";
passwordCommand = "${pkgs.pass}/bin/pass utd";
mbsync = {
enable = true;
create = "both";
expunge = "both";
patterns = [ "*" ];
};
imap = {
host = "outlook.office365.com";
port = 993;
tls.enable = true;
};
realName = "${name}";
msmtp.enable = true;
smtp = {
host = "smtp.office365.com";
port = 587;
tls.useStartTls = true;
};
};
};
};
programs = {
msmtp.enable = true;
mbsync.enable = true;
};
services = {
mbsync = {
enable = true;
frequency = "*:0/15";
preExec = "${pkgs.isync}/bin/mbsync -Ha";
postExec = "${pkgs.mu}/bin/mu index -m ${maildir}";
};
};
};
};
};
}