diff --git a/home/accounts.nix b/home/accounts.nix index 519ae22..df2f8fa 100644 --- a/home/accounts.nix +++ b/home/accounts.nix @@ -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"; }; }