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XGHVALXA7BSI4ZY2NUAC
5HLAP6OIMUSEZK2JBMEG7LUHNZZIBWPJBPZBB4S6FUBHD5L43VAQC
QOTSIIJGJAYIO5PLOSYF6NFUJSY4ITXDSJUE4IN6ZSJK6HOQTBJAC
3RG3K64UNBVMFYBBHNYCI7Y6GI7NZAHCCT76GMBBGK7PO4744BLAC
BAFCPHJKXP35F3DBWV5YHJWYAMYVYV2QXCU7VOTS67PINQTJDBOQC
FMMNSJMBROWJ6OC4MUBK6KSBJDQ7R26S33HZTQRAF5CF5VMFNE6QC
2KXMUFYOTAZO5GFGRFG6GGFJ3BIFO42O7CXBQRP2XH5WWZUOT6UAC
WHTEZBXRS7R3AM44LJZFR2YE6RP4IWE3AB5V3DYGO4YJU7PBTMQAC
7UWOMG432IHX7BGGN7PPQUGSSUP6CCQNBXOO7TKNMKMK2R2WFOGAC
let
chris-thelio = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDOiCjIMganzY45qiHFEO2NqkXz2mWsSEmq3zIoRJsiA root@nixos";
in {
"fastmail_password.age".publicKeys = [chris-thelio];
"fastmail_primary_address.age".publicKeys = [chris-thelio];
}
};
}
mbsync = {
enable = true;
create = "both";
expunge = "both";
remove = "both";
extraConfig.account = {
# NOTE microsoft office 365 imap servers may require this to be 1
# because they do not support concurrent imap commands
PipelineDepth = 50;
};
msmtp.enable = true;
imap.host = imapHost;
smtp.host = smtpHost;
passwordCommand =
if pkgs.stdenv.hostPlatform.isLinux
then "${pkgs.gnome3.libsecret}/bin/secret-tool lookup email ${email}"
else
# TODO use config.home.username
"security find-generic-password -a christophercummings -s ${email} -w";
in
{
email,
realName,
imapHost,
smtpHost,
gmail ? false,
}: {
inherit realName;
flavor =
if gmail
then "gmail.com"
else "plain";
address = email;
userName = email;
let
pkgs = import <nixpkgs> {};
let
template = import ./template.nix;
in
(template "email@email.domain" "Real Name" "imap.email.domain" "smtp.email.domain")
// {
# you can pass extra params here if necessary. otherwise omit the `// { ... }`
primary = true;
}
# TODO create systemd oneshot job to run `mbsync --all`
# and mu init
# and mu index
# so new systems are auto-setup
# without having to run those commands manually
accounts.email.accounts = {
"${primaryAddress}" = {
address = primaryAddress;
userName = primaryAddress;
realName = "Chris Cummings";
primary = true;
mbsync = {
enable = true;
create = "both";
expunge = "both";
remove = "both";
extraConfig.account.PipelineDepth = 50;
};
msmtp.enable = true;
imap.host = "imap.fastmail.com";
smtp.host = "smtp.fastmail.com";
passwordCommand = "cat ${secrets.fastmail_password.path}";
};
};
(set-email-account! "personal"
'((mu4e-sent-folder . "/personal/Sent")
(mu4e-drafts-folder . "/personal/Drafts")
(mu4e-trash-folder . "/personal/Trash")
(mu4e-refile-folder . "/personal/Archive"))
t)
(set-email-account! "icloud"
'((mu4e-sent-folder . "/icloud/Sent Messages")
(mu4e-drafts-folder . "/icloud/Drafts")
(mu4e-trash-folder . "/icloud/Deleted Messages")
(mu4e-refile-folder . "/icloud/Archive"))
t)
(set-email-account! "sure"
'((mu4e-sent-folder . "/sure/[Gmail]/Sent Mail")
(mu4e-drafts-folder . "/sure/[Gmail]/Drafts")
(mu4e-trash-folder . "/sure/[Gmail]/Trash")
(mu4e-refile-folder . "/sure/[Gmail]/All Mail"))
(set-email-account! "chris@thesogu.com"
'((mu4e-sent-folder . "/chris@thesogu.com/Sent")
(mu4e-drafts-folder . "/chris@thesogu.com/Drafts")
(mu4e-trash-folder . "/chris@thesogu.com/Trash")
(mu4e-refile-folder . "/chris@thesogu.com/Archive"))
"agenix": {
"inputs": {
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1652712410,
"narHash": "sha256-hMJ2TqLt0DleEnQFGUHK9sV2aAzJPU8pZeiZoqRozbE=",
"owner": "ryantm",
"repo": "agenix",
"rev": "7e5e58b98c3dcbf497543ff6f22591552ebfe65b",
"type": "github"
},
"original": {
"owner": "ryantm",
"repo": "agenix",
"type": "github"
}
},