This repository has been archived on 2024-07-03. You can view files and clone it, but cannot push or open issues or pull requests.
home-manager/services/email/default.nix
Evie Litherland-Smith eef58aa427 Don't start protonmail-bridge with plasma, setup systemd service
Move protonmail-bridge-setup and davmail-setup to respective email
definition files, rather than desktop settings

Update mimeapps with extra definitions from Plasma settings

Update README to rename protonmail-setup-bridge ->
protonmail-bridge-setup
2024-06-18 09:31:38 +01:00

103 lines
2.7 KiB
Nix

{
pkgs,
hostname,
...
}: {
home.packages = with pkgs; [
protonmail-bridge
(writeShellScriptBin "protonmail-bridge-setup" ''
systemctl --user stop protonmail-bridge
${protonmail-bridge}/bin/protonmail-bridge -c
systemctl --user restart protonmail-bridge
'')
];
accounts.email = {
maildirBasePath = "Mail";
accounts = let
realName = "Evie Litherland-Smith";
in {
proton = let
host = "127.0.0.1";
tls.enable = false;
in rec {
inherit realName;
primary = true;
maildir.path = "Proton";
imap = {
inherit host tls;
port = 1143;
};
smtp = {
inherit host tls;
port = 1025;
};
address = "e.litherlandsmith@proton.me";
aliases = ["evie@xenia.me.uk" "evie@litherlandsmith.slmail.me"];
userName = address;
passwordCommand = "${pkgs.pass}/bin/pass show mbsync/${hostname}/proton | head -n1";
mu.enable = true;
msmtp = {
enable = true;
extraConfig = {
tls = "off";
auth = "login";
};
};
mbsync = {
enable = true;
create = "both";
expunge = "both";
remove = "both";
patterns = ["*" "!All Mail" "!Labels*" "!Starred" "!Recovered Messages"];
subFolders = "Verbatim";
extraConfig.account.AuthMechs = "LOGIN";
};
};
icloud = rec {
inherit realName;
primary = false;
maildir.path = "iCloud";
imap.host = "imap.mail.me.com";
smtp.host = "smtp.mail.me.com";
address = "e.litherlandsmith@icloud.com";
userName = address;
passwordCommand = "${pkgs.pass}/bin/pass show mbsync/${hostname}/icloud | head -n1";
mu.enable = true;
msmtp.enable = true;
mbsync = {
enable = true;
create = "both";
expunge = "both";
remove = "both";
patterns = ["*" "!Notes"];
subFolders = "Verbatim";
};
};
};
};
programs = {
mu.enable = true;
msmtp.enable = true;
mbsync = {
enable = true;
groups.inboxes = {
proton = ["INBOX"];
icloud = ["INBOX"];
};
};
};
systemd.user.services.protonmail-bridge = {
Unit = {
Description = "Proton Mail Bridge";
Wants = ["network-online.target"];
After = ["network-online.target"];
};
Service = {
Environment = ["PATH=/run/current-system/sw/bin/:$PATH"];
Restart = "always";
ExecStart = "${pkgs.protonmail-bridge}/bin/protonmail-bridge -n";
};
Install.WantedBy = ["default.target"];
};
}