diff options
-rw-r--r-- | modules/home/mu.nix | 57 |
1 files changed, 21 insertions, 36 deletions
diff --git a/modules/home/mu.nix b/modules/home/mu.nix index 14361c5..c410702 100644 --- a/modules/home/mu.nix +++ b/modules/home/mu.nix @@ -11,58 +11,43 @@ in { mu.enable = true; msmtp.enable = true; mbsync.enable = true; + offlineimap.enable = true; }; services.mbsync = { enable = true; frequency = "*:0/5"; }; - accounts.email.accounts = { - personal = { - address = "[email protected]"; - userName = "[email protected]"; - imap.host = "imap.gmail.com"; - smtp.host = "smtp.gmail.com"; - primary = true; + accounts.email.accounts = let + gmailAccount = { email, secret, primary ? false } : { + inherit primary; + address = email; + userName = email; realName = "Leonardo Ribeiro Santiago"; - mbsync = { - enable = true; - create = "both"; - expunge = "both"; - }; - msmtp.enable = true; - mu.enable = true; - passwordCommand = "cat ${config.age.secrets.personal-mail.path}"; - }; - university = { - address = "[email protected]"; - userName = "[email protected]"; imap.host = "imap.gmail.com"; smtp.host = "smtp.gmail.com"; - realName = "Leonardo Ribeiro Santiago"; - mbsync = { - enable = true; - create = "both"; - expunge = "both"; - }; msmtp.enable = true; mu.enable = true; - passwordCommand = "cat ${config.age.secrets.university-mail.path}"; - }; - work = { - address = "[email protected]"; - userName = "[email protected]"; - imap.host = "imap.gmail.com"; - smtp.host = "smtp.gmail.com"; - realName = "Leonardo Ribeiro Santiago"; mbsync = { enable = true; create = "both"; expunge = "both"; }; - msmtp.enable = true; - mu.enable = true; - passwordCommand = "cat ${config.age.secrets.work-mail.path}"; + passwordCommand = "cat ${secret.path}"; + }; + in with config.age.secrets; { + personal = gmailAccount { + email = "[email protected]"; + secret = personal-mail; + primary = true; + }; + university = gmailAccount { + email = "[email protected]"; + secret = university-mail; }; + # supabase = gmailAccount { + # email = "[email protected]"; + # secret = supabase-mail; + # }; }; }; }; |