nixos-config/home-manager/email.nix

58 lines
1.3 KiB
Nix
Raw Normal View History

{ config, pkgs, lib, fullname, email, ... }:
2024-02-13 15:13:46 -05:00
let
2024-02-17 13:24:21 -05:00
ksumail = "bsheiban@students.kennesaw.edu";
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 22:26:36 -05:00
home.packages = [ pkgs.emacsPackages.mu4e ];
2024-02-13 21:37:27 -05:00
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";
passwordCommand = "${lib.getExe pass} email/GmailApp/${email}";
2024-02-13 15:13:46 -05:00
primary = true;
mbsync = {
enable = true;
create = "both";
expunge = "both";
patterns = [ "*" ];
};
realName = fullname;
msmtp.enable = true;
2024-02-13 22:26:36 -05:00
mu.enable = true;
2024-02-13 15:13:46 -05:00
};
2024-02-17 13:24:21 -05:00
ksu = {
address = ksumail;
userName = ksumail;
flavor = "outlook.office365.com";
passwordCommand = "${lib.getExe pass} email/${ksumail}";
2024-02-17 13:24:21 -05:00
mbsync = {
enable = true;
create = "both";
expunge = "both";
patterns = [ "*" ];
};
realName = fullname;
msmtp.enable = true;
mu.enable = true;
};
2024-02-13 15:13:46 -05:00
};
};
services = {
mbsync = {
enable = true;
postExec = "${lib.getExe pkgs.mu} index -m ${maildir}";
2024-02-13 15:13:46 -05:00
};
};
}