summaryrefslogtreecommitdiff
path: root/profiles/email/gmail.nix
diff options
context:
space:
mode:
authorMike Vink <mike1994vink@gmail.com>2023-10-06 23:10:55 +0200
committerMike Vink <mike1994vink@gmail.com>2023-10-06 23:10:55 +0200
commitcfaef26e8718916adcc68fbfb63b15f2389b2cd2 (patch)
tree3989af4514d31d0a5cb89e8b96d51210ad7bf152 /profiles/email/gmail.nix
parent654ec06ab6a885ea851c4cbf68d06a00b41b0e14 (diff)
move all the files
Diffstat (limited to 'profiles/email/gmail.nix')
-rw-r--r--profiles/email/gmail.nix118
1 files changed, 118 insertions, 0 deletions
diff --git a/profiles/email/gmail.nix b/profiles/email/gmail.nix
new file mode 100644
index 0000000..fa5d44e
--- /dev/null
+++ b/profiles/email/gmail.nix
@@ -0,0 +1,118 @@
+{
+ inputs,
+ config,
+ pkgs,
+ ...
+}: {
+ accounts.email = {
+ maildirBasePath = "${config.xdg.dataHome}/mail";
+ accounts = {
+ gmail = {
+ primary = true;
+ realName = "Mike Vink";
+ userName = "mike1994vink@gmail.com";
+ address = "mike1994vink@gmail.com";
+ passwordCommand = ["${pkgs.pass}/bin/pass" "personal/neomutt"];
+ imap = { host = "imap.gmail.com"; port = 993; tls = { enable = true; }; };
+ smtp = { host = "smtp.gmail.com"; port = 587; tls = { enable = true; useStartTls = true; }; };
+ msmtp = {
+ enable = true;
+ };
+ neomutt = {
+ enable = true;
+ sendMailCommand = "msmtp -a gmail";
+ mailboxName = "=== mike1994vink ===";
+ extraConfig = ''
+ set spoolfile='Inbox'
+ unvirtual-mailboxes *
+ '';
+ };
+ mbsync = {
+ enable = true;
+ create = "both"; remove = "both"; expunge = "both";
+ groups = {
+ gmail = {
+ channels = {
+ Inbox = { farPattern = "INBOX"; nearPattern = "INBOX"; extraConfig = { Create = "Near"; Expunge = "Both"; }; };
+ Archive = { farPattern = "[Gmail]/All Mail"; nearPattern = "Archive"; extraConfig = { Create = "Near"; Expunge = "Both"; }; };
+ Spam = { farPattern = "[Gmail]/Spam"; nearPattern = "Spam"; extraConfig = { Create = "Near"; Expunge = "Both"; }; };
+ Trash = { farPattern = "[Gmail]/Bin"; nearPattern = "Trash"; extraConfig = { Create = "Near"; Expunge = "Both"; }; };
+ Important = { farPattern = "[Gmail]/Important"; nearPattern = "Important"; extraConfig = { Create = "Near"; Expunge = "Both"; }; };
+ Sent = { farPattern = "[Gmail]/Sent Mail"; nearPattern = "Sent"; extraConfig = { Create = "Near"; Expunge = "Both"; }; };
+ FarDrafts = { farPattern = "[Gmail]/Drafts"; nearPattern = "FarDrafts"; extraConfig = { Create = "Near"; Expunge = "Both"; }; };
+ };
+ };
+ };
+ };
+ notmuch = {
+ enable = true;
+ neomutt = {
+ enable = true;
+ virtualMailboxes = [
+ { name = "Inbox"; query = "folder:/gmail/ tag:inbox"; }
+ { name = "Archive"; query = "folder:/gmail/ tag:archive"; }
+ { name = "Sent"; query = "folder:/gmail/ tag:sent"; }
+ { name = "Spam"; query = "folder:/gmail/ tag:spam"; }
+ { name = "Trash"; query = "folder:/gmail/ tag:trash"; }
+ { name = "Jobs"; query = "folder:/gmail/ tag:jobs"; }
+ { name = "Houses"; query = "folder:/gmail/ tag:houses"; }
+ { name = "Development"; query = "folder:/gmail/ tag:dev"; }
+ ];
+ };
+ };
+ };
+ family = {
+ primary = false;
+ realName = "Natalia & Mike Vink";
+ userName = "natalia.mike.vink@gmail.com";
+ address = "natalia.mike.vink@gmail.com";
+ passwordCommand = ["${pkgs.pass}/bin/pass" "personal/neomutt-family"];
+ imap = { host = "imap.gmail.com"; port = 993; tls = { enable = true; }; };
+ smtp = { host = "smtp.gmail.com"; port = 587; tls = { enable = true; useStartTls = true; }; };
+ msmtp = {
+ enable = true;
+ };
+ neomutt = {
+ enable = true;
+ sendMailCommand = "msmtp -a gmail";
+ mailboxName = "=== family ===";
+ extraConfig = ''
+ set spoolfile='Inbox'
+ unvirtual-mailboxes *
+ '';
+ };
+
+ mbsync = {
+ enable = true;
+ create = "both"; remove = "both"; expunge = "both";
+ groups = {
+ family = {
+ channels = {
+ Inbox = { farPattern = "INBOX"; nearPattern = "INBOX"; extraConfig = { Create = "Near"; Expunge = "Both"; }; };
+ Archive = { farPattern = "[Gmail]/All Mail"; nearPattern = "Archive"; extraConfig = { Create = "Near"; Expunge = "Both"; }; };
+ Spam = { farPattern = "[Gmail]/Spam"; nearPattern = "Spam"; extraConfig = { Create = "Near"; Expunge = "Both"; }; };
+ Trash = { farPattern = "[Gmail]/Bin"; nearPattern = "Trash"; extraConfig = { Create = "Near"; Expunge = "Both"; }; };
+ Important = { farPattern = "[Gmail]/Important"; nearPattern = "Important"; extraConfig = { Create = "Near"; Expunge = "Both"; }; };
+ Sent = { farPattern = "[Gmail]/Sent Mail"; nearPattern = "Sent"; extraConfig = { Create = "Near"; Expunge = "Both"; }; };
+ FarDrafts = { farPattern = "[Gmail]/Drafts"; nearPattern = "FarDrafts"; extraConfig = { Create = "Near"; Expunge = "Both"; }; };
+ };
+ };
+ };
+ };
+ notmuch = {
+ enable = true;
+ neomutt = {
+ enable = true;
+ virtualMailboxes = [
+ { name = "Inbox"; query = "folder:/family/ tag:inbox"; }
+ { name = "Archive"; query = "folder:/family/ tag:archive"; }
+ { name = "Sent"; query = "folder:/family/ tag:sent"; }
+ { name = "Spam"; query = "folder:/family/ tag:spam"; }
+ { name = "Trash"; query = "folder:/family/ tag:trash"; }
+ ];
+ };
+ };
+ };
+ };
+ };
+}