feat(mail): add tentative OAuth support
I can't actually test this yet, but maybe it works!
This commit is contained in:
parent
0e50de5c82
commit
fff22e6cb4
2 changed files with 439 additions and 3 deletions
|
|
@ -3,13 +3,27 @@ let
|
|||
ksumail = "bsheiban@students.kennesaw.edu";
|
||||
maildir = "${config.xdg.dataHome}/mail";
|
||||
pass = config.programs.password-store.package;
|
||||
|
||||
oauth-mail = pkgs.stdenv.mkDerivation {
|
||||
pname = "oauth-mail";
|
||||
version = "1.0.0";
|
||||
|
||||
buildInputs = [ pkgs.python3 ];
|
||||
|
||||
dontUnpack = true;
|
||||
installPhase = ''
|
||||
install -Dm755 ${./email/oauth-mail.py} \
|
||||
$out/bin/oauth-mail
|
||||
'';
|
||||
meta.mainProgram = "oauth-mail";
|
||||
};
|
||||
in {
|
||||
programs = {
|
||||
msmtp.enable = true;
|
||||
mbsync.enable = true;
|
||||
mu.enable = true;
|
||||
};
|
||||
home.packages = [ pkgs.emacsPackages.mu4e ];
|
||||
home.packages = [ pkgs.emacsPackages.mu4e oauth-mail ];
|
||||
|
||||
accounts.email = {
|
||||
maildirBasePath = maildir;
|
||||
|
|
@ -18,7 +32,7 @@ in {
|
|||
address = email;
|
||||
userName = email;
|
||||
flavor = "gmail.com";
|
||||
passwordCommand = "${lib.getExe pass} email/GmailApp/${email}";
|
||||
passwordCommand = "${lib.getExe pass} email/Auth/${email}";
|
||||
primary = true;
|
||||
mbsync = {
|
||||
enable = true;
|
||||
|
|
@ -34,7 +48,7 @@ in {
|
|||
address = ksumail;
|
||||
userName = ksumail;
|
||||
flavor = "outlook.office365.com";
|
||||
passwordCommand = "${lib.getExe pass} email/${ksumail}";
|
||||
passwordCommand = "${lib.getExe oauth-mail} $PASSWORD_STORE_DIR/email/Auth/${ksumail}";
|
||||
mbsync = {
|
||||
enable = true;
|
||||
create = "both";
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue