update email config

This commit is contained in:
Leonardo Eugênio 2023-01-22 02:30:20 -03:00
parent b0610e6854
commit f42a3fd7c6

View file

@ -1,22 +1,12 @@
{ pkgs, ... }:
let
get_pass = pkgs.writeShellScript "get_pass" ''
pass disroot.org | head -n1
'';
in {
accounts.email.accounts = {
"personal" = {
primary = true;
{ pkgs, ... }: {
accounts.email.accounts = let
mkAccount = username: host: passName: {
realName = "Leonardo Eugênio";
address = "lelgenio@disroot.org";
userName = "lelgenio";
address = "${username}@${host}";
userName = username;
astroid.enable = true;
imap = {
host = "disroot.org";
# port = 993;
};
smtp = { host = "disroot.org"; };
imap.host = host;
smtp.host = host;
imapnotify = {
enable = true;
onNotify = "${pkgs.isync}/bin/mbsync -a";
@ -29,8 +19,13 @@ in {
};
msmtp.enable = true;
notmuch.enable = true;
passwordCommand = toString get_pass;
passwordCommand = toString (pkgs.writeShellScript "get_pass" ''
pass ${passName} | head -n1
'');
};
in {
"personal" = (mkAccount "lelgenio" "disroot.org" "disroot.org") // { primary = true; } ;
"work" = mkAccount "leonardo" "wopus.com.br" "Trabalho/wopus_email/leonardo@wopus.com.br";
};
services.imapnotify.enable = true;