Configure email client

This commit is contained in:
Kiana Sheibani 2024-02-13 15:13:46 -05:00
parent fbbee3a200
commit d8e0210c30
3 changed files with 43 additions and 4 deletions

37
home-manager/email.nix Normal file
View file

@ -0,0 +1,37 @@
{ pkgs, fullname, email, ... }:
let
maildir = "/home/kiana/.mail";
in {
accounts.email = {
maildirBasePath = maildir;
accounts = {
Gmail = {
address = email;
userName = email;
flavor = "gmail.com";
primary = true;
mbsync = {
enable = true;
create = "both";
expunge = "both";
patterns = [ "*" ];
};
realName = fullname;
msmtp.enable = true;
};
};
};
programs = {
msmtp.enable = true;
mbsync.enable = true;
};
services = {
mbsync = {
enable = true;
preExec = "${pkgs.isync}/bin/mbsync -Ha";
postExec = "${pkgs.mu}/bin/mu index -m ${maildir}";
};
};
}