dotfiles/nixos/email-accounts.nix

82 lines
1.7 KiB
Nix
Raw Normal View History

2021-06-13 12:05:16 +01:00
{ config, pkgs, ... }:
{
home-manager.users.cyryl = {...}: {
accounts.email.accounts.cyplo = {
primary = true;
address = "cyplo@cyplo.dev";
2021-06-13 12:05:16 +01:00
aliases = [ "cyplo@cyplo.net" ];
realName = "Cyryl Płotnicki";
userName = "cyplo";
imap = {
host = "127.0.0.1";
port = 1143;
tls.enable = false;
};
smtp = {
host = "127.0.0.1";
port = 1025;
tls.enable = false;
};
notmuch.enable = true;
astroid.enable = true;
msmtp.enable = true;
passwordCommand = "${pkgs.pass}/bin/pass proton-bridge";
mbsync = {
enable = true;
create = "maildir";
};
folders = {
2021-07-03 13:15:42 +01:00
drafts = "Drafts";
inbox = "INBOX";
sent = "Sent";
trash = "Trash";
};
};
services = {
imapnotify.enable = true;
mbsync = {
enable = true;
frequency = "hourly";
postExec = "${pkgs.notmuch}/bin/notmuch new";
};
};
programs.mbsync.enable = true;
programs.msmtp.enable = true;
programs.notmuch = {
enable = true;
hooks = {
preNew = "mbsync --all";
};
};
programs.astroid = {
enable = true;
pollScript = "${pkgs.notmuch}/bin/notmuch new";
extraConfig = {
attachments = {
external_open_cmd = "${pkgs.xdg_utils}/bin/xdg-open";
};
};
};
programs.alot = {
enable = true;
2021-06-13 12:05:16 +01:00
};
home.packages = with pkgs; [
hydroxide
];
2021-07-03 13:15:42 +01:00
2021-06-13 12:05:16 +01:00
systemd.user.services."hydroxide" = {
Unit.Description = "Bridge to ProtonMail";
Install.WantedBy = [ "default.target" ];
Service.ExecStart = "${pkgs.hydroxide}/bin/hydroxide serve";
};
};
}