split email accounts

This commit is contained in:
Michael Thomson 2025-07-08 14:02:57 -04:00
parent a6b6ed3bc7
commit e21c306269
Signed by: mthomson
GPG Key ID: B6CA05EE5F436C79
2 changed files with 163 additions and 153 deletions

View File

@ -672,15 +672,11 @@
:straight t :straight t
:bind (("C-c m" . notmuch-hello)) :bind (("C-c m" . notmuch-hello))
:custom :custom
(notmuch-search-oldest-first nil)
(notmuch-saved-searches (notmuch-saved-searches
'((:name "inbox (personal)" :query "tag:inbox AND tag:personal") '((:name "inbox" :query "tag:inbox")
(:name "unread (personal)" :query "tag:unread AND tag:personal") (:name "unread" :query "tag:unread")
(:name "sent (personal)" :query "tag:sent AND tag:personal") (:name "sent" :query "tag:sent")
(:name "all mail (personal)" :query "tag:personal")
(:name "inbox (work)" :query "tag:inbox AND tag:work")
(:name "unread (work)" :query "tag:unread AND tag:work")
(:name "sent (work)" :query "tag:sent AND tag:work")
(:name "all mail (work)" :query "tag:work")
(:name "drafts" :query "tag:draft"))) (:name "drafts" :query "tag:draft")))
:init :init
(add-hook 'message-send-hook (lambda () (add-hook 'message-send-hook (lambda ()

View File

@ -1,6 +1,7 @@
{ {
pkgs, pkgs,
config, osConfig,
lib,
... ...
}: { }: {
home.packages = with pkgs; [ home.packages = with pkgs; [
@ -23,21 +24,6 @@
programs = { programs = {
aerc = { aerc = {
enable = true; enable = true;
templates = {
thanks = ''
Thanks!
{{exec "{ git remote get-url --push origin; git reflog -2 origin/master --pretty=format:%h | xargs printf '%s\n' | tac; } | xargs printf 'To %s\n %s..%s master -> master'" ""}}
'';
};
# extraBinds = {
# messages = {
# ga = ":flag<Enter>:pipe -mb git am -3<Enter>";
# gp = ":term git push<Enter>";
# gl = ":term git log<Enter>";
# rt = ":reply -a -Tthanks<Enter>";
# };
# };
extraConfig = { extraConfig = {
ui = { ui = {
sort = "-r arrival"; sort = "-r arrival";
@ -50,7 +36,7 @@
unsafe-accounts-conf = true; unsafe-accounts-conf = true;
}; };
compose = { compose = {
address-book-cmd = "khard email --parsable --remove-first-line %s"; address-book-cmd = "notmuch address \"%s\"";
}; };
filters = { filters = {
"text/plain" = "colorize"; "text/plain" = "colorize";
@ -65,27 +51,6 @@
mbsync = { mbsync = {
enable = true; enable = true;
}; };
notmuch = {
enable = true;
new.tags = [ "new" ];
hooks = {
postNew = ''
notmuch tag +personal "path:personal/**"
notmuch tag +work "path:work/**"
notmuch tag +sent -new tag:new from:michael@michaelthomson.dev
notmuch tag +sent -new tag:new from:mthomson@konradgroup.com
notmuch tag +cal attachment:.ics
notmuch tag +inbox +unread -new "tag:new"
'';
preNew = ''
mbsync -a
(cd ~/Maildir/work/ && gmi sync)
'';
};
};
lieer = { lieer = {
enable = true; enable = true;
}; };
@ -103,123 +68,172 @@
}; };
}; };
accounts = { programs.notmuch = lib.mkMerge [
email = { {
accounts.personal = { enable = true;
primary = true; new.tags = [ "new" ];
address = "michael@michaelthomson.dev"; }
realName = "Michael Thomson"; (lib.mkIf (osConfig.networking.hostName == "macbook") {
userName = "michael@michaelthomson.dev"; hooks = {
passwordCommand = "rbw get --folder email michael@michaelthomson.dev"; postNew = ''
aerc = { notmuch tag +sent -new tag:new from:mthomson@konradgroup.com
enable = true;
notmuch tag +cal attachment:.ics
notmuch tag +inbox +unread -new "tag:new"
'';
preNew = ''
cd ~/Maildir/work/ && gmi sync
'';
}; };
mbsync = { })
enable = true; (lib.mkIf (osConfig.networking.hostName != "macbook") {
create = "both"; hooks = {
expunge = "both"; postNew = ''
notmuch tag +sent -new tag:new from:michael@michaelthomson.dev
notmuch tag +cal attachment:.ics
notmuch tag +inbox +unread -new "tag:new"
'';
preNew = ''
mbsync -a
'';
}; };
imap = { })
host = "mail.michaelthomson.dev"; ];
port = 993;
tls = { accounts = lib.mkMerge [
(lib.mkIf (osConfig.networking.hostName == "macbook") {
email = {
accounts.work = {
primary = true;
flavor = "gmail.com";
address = "mthomson@konradgroup.com";
realName = "Michael Thomson";
aerc = {
enable = true;
# extraBinds = {
# messages = {
# md = ":modify-labels +trash<Enter>";
# };
# };
extraAccounts = {
source = "maildir://~/Maildir/work";
};
};
notmuch = {
enable = true;
};
lieer = {
enable = true;
settings = {
replace_slash_with_dot = true;
ignore_tags = [ "new" "personal" "work" ];
};
};
};
};
})
(lib.mkIf (osConfig.networking.hostName != "macbook") {
email = {
accounts.personal = {
primary = true;
address = "michael@michaelthomson.dev";
realName = "Michael Thomson";
userName = "michael@michaelthomson.dev";
passwordCommand = "rbw get --folder email michael@michaelthomson.dev";
aerc = {
enable = true;
};
mbsync = {
enable = true;
create = "both";
expunge = "both";
};
imap = {
host = "mail.michaelthomson.dev";
port = 993;
tls = {
enable = true;
};
};
msmtp = {
enable = true;
};
smtp = {
host = "mail.michaelthomson.dev";
port = 465;
tls = {
enable = true;
};
};
notmuch = {
enable = true;
};
mu = {
enable = true; enable = true;
}; };
}; };
msmtp = { };
enable = true; calendar = {
}; basePath = ".calendar";
smtp = { accounts.personal = {
host = "mail.michaelthomson.dev"; primary = true;
port = 465; primaryCollection = "personal";
tls = { remote = {
type = "caldav";
url = "https://nextcloud.michaelthomson.dev/remote.php/dav";
userName = "michael@michaelthomson.dev";
passwordCommand = [
"rbw"
"get"
"nextcloud.michaelthomson.dev"
];
};
vdirsyncer = {
enable = true; enable = true;
auth = "basic";
collections = ["personal"];
}; };
}; khal = {
notmuch = { enable = true;
enable = true; type = "calendar";
};
mu = {
enable = true;
};
};
accounts.work = {
primary = false;
flavor = "gmail.com";
address = "mthomson@konradgroup.com";
realName = "Michael Thomson";
aerc = {
enable = true;
};
notmuch = {
enable = true;
};
lieer = {
enable = true;
settings = {
replace_slash_with_dot = true;
ignore_tags = [ "new" "personal" "work" ];
}; };
}; };
}; };
}; contact = {
calendar = { basePath = ".contacts";
basePath = ".calendar"; accounts.personal = {
accounts.personal = { local = {
primary = true; type = "filesystem";
primaryCollection = "personal"; fileExt = ".vcf";
remote = { };
type = "caldav"; remote = {
url = "https://nextcloud.michaelthomson.dev/remote.php/dav"; type = "carddav";
userName = "michael@michaelthomson.dev"; url = "https://nextcloud.michaelthomson.dev/remote.php/dav";
passwordCommand = [ userName = "michael@michaelthomson.dev";
"rbw" passwordCommand = [
"get" "rbw"
"nextcloud.michaelthomson.dev" "get"
]; "nextcloud.michaelthomson.dev"
}; ];
vdirsyncer = { };
enable = true; vdirsyncer = {
auth = "basic"; enable = true;
collections = ["personal"]; auth = "basic";
}; collections = ["contacts"];
khal = { };
enable = true; khal = {
type = "calendar"; enable = true;
collections = ["contacts"];
};
khard = {
enable = true;
defaultCollection = "contacts";
};
}; };
}; };
}; })
contact = { ];
basePath = ".contacts";
accounts.personal = {
local = {
type = "filesystem";
fileExt = ".vcf";
};
remote = {
type = "carddav";
url = "https://nextcloud.michaelthomson.dev/remote.php/dav";
userName = "michael@michaelthomson.dev";
passwordCommand = [
"rbw"
"get"
"nextcloud.michaelthomson.dev"
];
};
vdirsyncer = {
enable = true;
auth = "basic";
collections = ["contacts"];
};
khal = {
enable = true;
collections = ["contacts"];
};
khard = {
enable = true;
defaultCollection = "contacts";
};
};
};
};
} }