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
:bind (("C-c m" . notmuch-hello))
:custom
(notmuch-search-oldest-first nil)
(notmuch-saved-searches
'((:name "inbox (personal)" :query "tag:inbox AND tag:personal")
(:name "unread (personal)" :query "tag:unread AND tag:personal")
(:name "sent (personal)" :query "tag:sent AND tag:personal")
(: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 "inbox" :query "tag:inbox")
(:name "unread" :query "tag:unread")
(:name "sent" :query "tag:sent")
(:name "drafts" :query "tag:draft")))
:init
(add-hook 'message-send-hook (lambda ()

View File

@ -1,6 +1,7 @@
{
pkgs,
config,
osConfig,
lib,
...
}: {
home.packages = with pkgs; [
@ -23,21 +24,6 @@
programs = {
aerc = {
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 = {
ui = {
sort = "-r arrival";
@ -50,7 +36,7 @@
unsafe-accounts-conf = true;
};
compose = {
address-book-cmd = "khard email --parsable --remove-first-line %s";
address-book-cmd = "notmuch address \"%s\"";
};
filters = {
"text/plain" = "colorize";
@ -65,27 +51,6 @@
mbsync = {
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 = {
enable = true;
};
@ -103,123 +68,172 @@
};
};
accounts = {
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;
programs.notmuch = lib.mkMerge [
{
enable = true;
new.tags = [ "new" ];
}
(lib.mkIf (osConfig.networking.hostName == "macbook") {
hooks = {
postNew = ''
notmuch tag +sent -new tag:new from:mthomson@konradgroup.com
notmuch tag +cal attachment:.ics
notmuch tag +inbox +unread -new "tag:new"
'';
preNew = ''
cd ~/Maildir/work/ && gmi sync
'';
};
mbsync = {
enable = true;
create = "both";
expunge = "both";
})
(lib.mkIf (osConfig.networking.hostName != "macbook") {
hooks = {
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;
};
};
msmtp = {
enable = true;
};
smtp = {
host = "mail.michaelthomson.dev";
port = 465;
tls = {
};
calendar = {
basePath = ".calendar";
accounts.personal = {
primary = true;
primaryCollection = "personal";
remote = {
type = "caldav";
url = "https://nextcloud.michaelthomson.dev/remote.php/dav";
userName = "michael@michaelthomson.dev";
passwordCommand = [
"rbw"
"get"
"nextcloud.michaelthomson.dev"
];
};
vdirsyncer = {
enable = true;
auth = "basic";
collections = ["personal"];
};
};
notmuch = {
enable = true;
};
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" ];
khal = {
enable = true;
type = "calendar";
};
};
};
};
calendar = {
basePath = ".calendar";
accounts.personal = {
primary = true;
primaryCollection = "personal";
remote = {
type = "caldav";
url = "https://nextcloud.michaelthomson.dev/remote.php/dav";
userName = "michael@michaelthomson.dev";
passwordCommand = [
"rbw"
"get"
"nextcloud.michaelthomson.dev"
];
};
vdirsyncer = {
enable = true;
auth = "basic";
collections = ["personal"];
};
khal = {
enable = true;
type = "calendar";
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";
};
};
};
};
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";
};
};
};
};
})
];
}