dotfiles/nixos/email-accounts.nix
Cyryl Płotnicki d5d186c25f
Some checks failed
use nix / build (push) Failing after 4m55s
upgrade foryog
2024-12-17 08:20:20 +00:00

82 lines
2.1 KiB
Nix

{
config,
pkgs,
inputs,
...
}: let
unstable = inputs.nixpkgs-nixos-unstable.legacyPackages.${pkgs.system};
in {
home-manager.users.cyryl = {
accounts.email.accounts.cyplo = {
primary = true;
address = "cyplo@cyplo.dev";
aliases = ["cyplo@cyplo.net"];
realName = "Cyryl Płotnicki";
userName = "cyplo@cyplo.dev";
imap = {
host = "127.0.0.1";
port = 1143;
tls = {
enable = true;
useStartTls = true;
certificatesFile = "/home/cyryl/.config/protonmail/bridge/cert.pem";
};
};
smtp = {
host = "127.0.0.1";
port = 1025;
tls = {
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";
};
};
notmuch.enable = true;
neomutt.enable = true;
passwordCommand = "${pkgs.pass}/bin/pass proton-bridge";
folders = {
drafts = "Drafts";
inbox = "INBOX";
sent = "Sent";
trash = "Trash";
};
};
programs = {
mbsync.enable = true;
msmtp.enable = true;
neomutt = {enable = true;};
notmuch = {
enable = true;
hooks.preNew = "${pkgs.isync}/bin/mbsync -a";
};
};
home.packages = [unstable.protonmail-bridge];
services.mbsync.enable = true;
home.file.".mailcap".text = ''
text/html; ${pkgs.w3m}/bin/w3m -dump -o document_charset=%{charset} '%s'; nametemplate=%s.html; copiousoutput
'';
systemd.user.services."proton-bridge" = {
Unit.Description = "Bridge to ProtonMail";
Install.WantedBy = ["default.target" "mbsync.service"];
Service.ExecStart = "${unstable.protonmail-bridge}/bin/protonmail-bridge --noninteractive";
Service.Environment = "PATH=${pkgs.pass}/bin:${pkgs.gnupg}/bin";
};
};
}