nixos/home/accounts/email.nix
Evie Litherland-Smith 2579ddbaa9 Move accounts file into separate directory
Started accounts/email.nix to prep separation for adding calendar and
contact expressions

Move maildir back to ~/.mail to be consistent with ~/.calendar and ~/.contact
2023-09-25 13:42:13 +01:00

74 lines
1.8 KiB
Nix

{ pkgs, hostName, ... }:
{
accounts.email.maildirBasePath = ".mail";
accounts.email.accounts = let realName = "Evelyn Litherland-Smith";
in {
proton = let
host = "127.0.0.1";
tls.enable = false;
in rec {
inherit realName;
maildir.path = "Proton";
imap = {
inherit host tls;
port = 1143;
};
smtp = {
inherit host tls;
port = 1025;
};
address = "e.litherlandsmith@proton.me";
aliases = [ "evie@xenia.me.uk" "evie@litherlandsmith.slmail.me" ];
passwordCommand = "${pkgs.pass}/bin/pass show Mail/Proton/${hostName}";
primary = true;
userName = address;
mbsync = {
enable = true;
create = "both";
expunge = "both";
patterns =
[ "INBOX" "Archive" "Drafts" "Sent" "Spam" "Starred" "Trash" ];
subFolders = "Verbatim";
extraConfig.account.AuthMechs = "LOGIN";
};
msmtp = {
enable = true;
extraConfig = {
tls = "off";
auth = "login";
};
};
mu.enable = true;
};
icloud = rec {
inherit realName;
maildir.path = "iCloud";
imap.host = "imap.mail.me.com";
smtp.host = "smtp.mail.me.com";
address = "e.litherlandsmith@icloud.com";
passwordCommand = "${pkgs.pass}/bin/pass show Mail/iCloud/mbsync";
userName = address;
mbsync = {
enable = true;
create = "both";
expunge = "both";
subFolders = "Verbatim";
};
msmtp.enable = true;
mu.enable = true;
};
};
home.packages = with pkgs; [ protonmail-bridge ];
programs = {
mbsync.enable = true;
msmtp.enable = true;
# vdirsyncer = { enable = true; };
mu.enable = true;
};
services.mbsync = {
enable = true;
frequency = "*-*-* *:0/15:00";
};
}