dotfiles/nixos/email-accounts.nix

84 lines
2.1 KiB
Nix
Raw Normal View History

2022-12-19 09:09:08 +00:00
{
config,
pkgs,
inputs,
...
}: let
unstable = inputs.nixpkgs-nixos-unstable.legacyPackages.${pkgs.system};
2022-03-10 12:25:23 +00:00
in {
2022-05-02 09:59:47 +01:00
home-manager.users.cyryl = {
2021-06-13 12:05:16 +01:00
accounts.email.accounts.cyplo = {
primary = true;
address = "cyplo@cyplo.dev";
2022-12-19 09:09:08 +00:00
aliases = ["cyplo@cyplo.net"];
2021-06-13 12:05:16 +01:00
realName = "Cyryl Płotnicki";
2022-01-08 10:23:29 +00:00
userName = "cyplo@cyplo.dev";
imap = {
host = "127.0.0.1";
port = 1143;
2021-12-26 15:32:54 +00:00
tls = {
2022-02-20 14:40:37 +00:00
enable = true;
useStartTls = true;
certificatesFile = "/home/cyryl/.config/protonmail/bridge/cert.pem";
2021-12-26 15:32:54 +00:00
};
};
smtp = {
host = "127.0.0.1";
port = 1025;
2022-01-08 10:23:29 +00:00
tls = {
2022-02-20 14:40:37 +00:00
enable = true;
useStartTls = true;
certificatesFile = "/home/cyryl/.config/protonmail/bridge/cert.pem";
};
};
mbsync = {
enable = true;
create = "maildir";
expunge = "maildir";
remove = "maildir";
};
msmtp = {
enable = true;
extraConfig = {
from = "cyplo@cyplo.dev";
auth = "plain";
2022-01-08 10:23:29 +00:00
};
};
notmuch.enable = true;
2022-02-20 14:40:37 +00:00
neomutt.enable = true;
passwordCommand = "${pkgs.pass}/bin/pass proton-bridge";
folders = {
2021-07-03 13:15:42 +01:00
drafts = "Drafts";
inbox = "INBOX";
sent = "Sent";
trash = "Trash";
};
};
2024-04-21 19:16:41 +01:00
programs = {
mbsync.enable = true;
msmtp.enable = true;
neomutt = {enable = true;};
notmuch = {
enable = true;
hooks.preNew = "${pkgs.isync}/bin/mbsync -a";
};
alot = {enable = true;};
};
2024-04-21 19:16:41 +01:00
home.packages = [unstable.protonmail-bridge];
2021-06-13 12:05:16 +01:00
2022-02-20 14:40:37 +00:00
services.mbsync.enable = true;
home.file.".mailcap".text = ''
text/html; ${pkgs.w3m}/bin/w3m -dump -o document_charset=%{charset} '%s'; nametemplate=%s.html; copiousoutput
'';
2022-01-08 10:23:29 +00:00
systemd.user.services."proton-bridge" = {
2021-06-13 12:05:16 +01:00
Unit.Description = "Bridge to ProtonMail";
2022-12-19 09:09:08 +00:00
Install.WantedBy = ["default.target" "mbsync.service"];
Service.ExecStart = "${unstable.protonmail-bridge}/bin/protonmail-bridge --noninteractive";
2022-02-20 14:40:37 +00:00
Service.Environment = "PATH=${pkgs.pass}/bin:${pkgs.gnupg}/bin";
2021-06-13 12:05:16 +01:00
};
};
}