Add email configuration

This commit is contained in:
Leonardo Eugênio 2023-01-22 02:13:10 -03:00
parent 0f9fa0cf6e
commit 414de370fc
2 changed files with 47 additions and 0 deletions

46
user/email.nix Normal file
View file

@ -0,0 +1,46 @@
{ pkgs, ... }:
let
get_pass = pkgs.writeShellScript "get_pass" ''
pass disroot.org | head -n1
'';
in {
accounts.email.accounts = {
"personal" = {
primary = true;
realName = "Leonardo Eugênio";
address = "lelgenio@disroot.org";
userName = "lelgenio";
astroid.enable = true;
imap = {
host = "disroot.org";
# port = 993;
};
smtp = { host = "disroot.org"; };
imapnotify = {
enable = true;
onNotify = "${pkgs.isync}/bin/mbsync -a";
onNotifyPost =
"${pkgs.notmuch}/bin/notmuch new && ${pkgs.libnotify}/bin/ notify-send 'New mail arrived'";
};
mbsync = {
enable = true;
create = "both";
};
msmtp.enable = true;
notmuch.enable = true;
passwordCommand = toString get_pass;
};
};
services.imapnotify.enable = true;
programs.mbsync.enable = true;
services.mbsync.enable = true;
services.mbsync.postExec = "${pkgs.notmuch}/bin/notmuch new";
programs.notmuch.enable = true;
programs.msmtp.enable = true;
programs.astroid.enable = true;
}

View file

@ -19,6 +19,7 @@ in {
./rnnoise.nix ./rnnoise.nix
./mimeapps.nix ./mimeapps.nix
./chat.nix ./chat.nix
./email.nix
./syncthing.nix ./syncthing.nix
./bmenu.nix ./bmenu.nix
./fzf.nix ./fzf.nix