dotfiles/nixos/email-accounts.nix
Cyryl Płotnicki 3d6dd759c4 nixfmt
2022-03-10 12:25:23 +00:00

75 lines
2 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;
programs.msmtp.enable = true;
programs.neomutt = { enable = true; };
programs.notmuch = {
enable = true;
hooks.preNew = "${pkgs.isync}/bin/mbsync -a";
};
programs.alot = { enable = true; };
home.packages = with pkgs; [ unstable.protonmail-bridge ];
services.mbsync.enable = true;
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";
};
};
}