diff options
author | Leonardo Santiago <[email protected]> | 2025-07-02 10:33:30 -0300 |
---|---|---|
committer | Leonardo Santiago <[email protected]> | 2025-07-02 10:33:30 -0300 |
commit | 4dab2e0cdcb50a4cb54af5cdfd637f4a17ac17b2 (patch) | |
tree | 8a7a43666ed04e91181bd5e2185f1d3446c73a0e /modules | |
parent | fd29cbf7c014e88122e3879f6a9a69ff7e922be9 (diff) |
fix: refactor `mu.nix`
Diffstat (limited to 'modules')
-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; + # }; }; }; }; |