aboutsummaryrefslogtreecommitdiff
path: root/users/tdback/modules/email/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'users/tdback/modules/email/default.nix')
-rw-r--r--users/tdback/modules/email/default.nix78
1 files changed, 78 insertions, 0 deletions
diff --git a/users/tdback/modules/email/default.nix b/users/tdback/modules/email/default.nix
new file mode 100644
index 0000000..3321462
--- /dev/null
+++ b/users/tdback/modules/email/default.nix
@@ -0,0 +1,78 @@
+{ pkgs, ... }:
+{
+ accounts.email = {
+ maildirBasePath = "mail";
+
+ accounts.fastmail = {
+ primary = true;
+ address = "tyler@tdback.net";
+ userName = "tyler@tdback.net";
+ realName = "Tyler Dunneback";
+ passwordCommand = "${pkgs.age}/bin/age -d -i ~/.ssh/mail ~/.mail.age";
+
+ folders = {
+ inbox = "Inbox";
+ drafts = "Drafts";
+ sent = "Sent";
+ trash = "Trash";
+ };
+
+ imap = {
+ host = "imap.fastmail.com";
+ port = 993;
+ tls = {
+ enable = true;
+ certificatesFile = "/etc/ssl/certs/ca-certificates.crt";
+ };
+ };
+
+ smtp = {
+ host = "smtp.fastmail.com";
+ port = 465;
+ tls = {
+ enable = true;
+ useStartTls = false;
+ certificatesFile = "/etc/ssl/certs/ca-certificates.crt";
+ };
+ };
+
+ mbsync = {
+ enable = true;
+ create = "both";
+ expunge = "none";
+ subFolders = "Verbatim";
+ patterns = [ "*" ];
+ };
+
+ msmtp = {
+ enable = true;
+ extraConfig = {
+ logfile = "~/.cache/msmtp/msmtp.log";
+ };
+ };
+
+ neomutt = {
+ enable = true;
+ sendMailCommand = "msmtp";
+ mailboxType = "maildir";
+ extraMailboxes = [
+ "Drafts"
+ "Sent"
+ "Trash"
+ "Archive"
+ ];
+ };
+ };
+ };
+
+ programs = {
+ mbsync.enable = true;
+ msmtp.enable = true;
+ };
+
+ services.mbsync = {
+ enable = true;
+ package = pkgs.isync;
+ frequency = "*:0/5";
+ };
+}