add icloud account to nix

This commit is contained in:
willemml 2023-03-12 16:24:24 -07:00
parent 0828229e9d
commit 83050bd87d
Signed by: willemml
GPG key ID: C3DE5DF6198DACBD

View file

@ -2,18 +2,11 @@
let
passCmd = path: "${pkgs.pass}/bin/pass ${path}";
gmailAccount = address: {
generalAccount = address: {
inherit address;
flavor = "gmail.com";
folders = {
drafts = "[Gmail].Drafts";
inbox = "INBOX";
sent = "[Gmail].Sent Mail";
trash = "[Gmail].Trash";
};
userName = address;
mu.enable = true;
offlineimap.enable = true;
passwordCommand = passCmd "gmail/${address}";
imap.tls = {
enable = true;
useStartTls = true;
@ -22,12 +15,30 @@ let
enable = true;
useStartTls = true;
};
passwordCommand = passCmd "email/${address}";
};
gmailAccount = address: ({
flavor = "gmail.com";
folders = {
drafts = "[Gmail].Drafts";
inbox = "INBOX";
sent = "[Gmail].Sent Mail";
trash = "[Gmail].Trash";
};
} // generalAccount address);
in
{
accounts.email.accounts = {
gmail = gmailAccount "willemleitso@gmail.com";
leitso = (gmailAccount "willem@leit.so") // { primary = true; };
gmail = (gmailAccount "willemleitso@gmail.com") // { realName = "Willem Leitso"; };
icloud = (pkgs.lib.attrsets.recursiveUpdate {
flavor = "plain";
imap.host = "imap.mail.me.com";
imap.port = 993;
smtp.host = "smtp.mail.me.com";
smtp.port = 587;
} (generalAccount "coalminecraft@icloud.com")) // { folders.inbox = "INBOX"; };
leitso = (gmailAccount "willem@leit.so") // { primary = true; realName = "Willem Leitso"; };
wnuke9 = gmailAccount "wnuke9@gmail.com";
};
}