nixos-config/home-manager/email.nix

41 lines
904 B
Nix
Raw Normal View History

2024-02-13 15:30:26 -05:00
{ config, pkgs, fullname, email, ... }:
2024-02-13 15:13:46 -05:00
let
2024-02-13 15:30:26 -05:00
maildir = "${config.xdg.dataHome}/mail";
pass = config.programs.password-store.package;
2024-02-13 15:13:46 -05:00
in {
2024-02-13 21:37:27 -05:00
programs = {
msmtp.enable = true;
mbsync.enable = true;
mu.enable = true;
};
2024-02-13 15:13:46 -05:00
accounts.email = {
maildirBasePath = maildir;
accounts = {
2024-02-13 15:30:26 -05:00
gmail = {
2024-02-13 15:13:46 -05:00
address = email;
userName = email;
flavor = "gmail.com";
2024-02-13 21:37:27 -05:00
passwordCommand = "${pass}/bin/pass Email/GmailApp/kiana.a.sheibani@gmail.com";
2024-02-13 15:13:46 -05:00
primary = true;
mbsync = {
enable = true;
create = "both";
expunge = "both";
patterns = [ "*" ];
};
realName = fullname;
msmtp.enable = true;
};
};
};
services = {
mbsync = {
enable = true;
preExec = "${pkgs.isync}/bin/mbsync -Ha";
postExec = "${pkgs.mu}/bin/mu index -m ${maildir}";
};
};
}