dotfiles/modules/mail/himalaya.nix

88 lines
2.2 KiB
Nix
Raw Normal View History

2022-05-11 03:45:50 +00:00
{ config, pkgs, lib, ... }: {
options = {
mailServer = lib.mkOption {
type = lib.types.str;
description = "Server name for the email address.";
};
};
config = {
home-manager.users.${config.user} = {
programs.himalaya = { enable = true; };
2022-05-17 02:05:21 +00:00
programs.mbsync = { enable = true; };
services.mbsync = {
enable = true;
frequency = "*:0/5";
};
2022-05-11 03:45:50 +00:00
accounts.email = {
maildirBasePath = "/home/${config.user}/mail";
accounts = {
2022-05-17 02:05:21 +00:00
home = let
2022-05-11 03:45:50 +00:00
address = "${config.user}@${config.mailServer}";
serverHostname = "mail.${config.mailServer}";
in {
userName = address;
realName = config.fullName;
primary = true;
inherit address;
aliases = map (mailUser: "${mailUser}@${config.mailServer}") [
"me"
"hey"
"admin"
];
alot = { };
flavor = "plain";
folders = { };
getmail = { };
himalaya = {
enable = true;
2022-05-14 21:36:38 +00:00
settings = {
downloads-dir = config.userDirs.download;
smtp-insecure = true;
};
2022-05-11 03:45:50 +00:00
};
imap = {
host = serverHostname;
port = 993;
tls.enable = true;
};
imapnotify = {
enable = false;
boxes = [ ];
onNotify = "";
onNotifyPost = "";
};
maildir = { path = "main"; };
mbsync = {
2022-05-17 02:05:21 +00:00
enable = true;
2022-05-11 03:45:50 +00:00
create = "maildir";
expunge = "none";
remove = "none";
patterns = [ "*" ];
};
mu.enable = false;
notmuch.enable = false;
passwordCommand =
2022-05-15 19:24:16 +00:00
"${pkgs.age}/bin/age --decrypt --identity /home/${config.user}/.ssh/id_ed25519 ${
2022-05-12 01:08:16 +00:00
builtins.toString ./mailpass.age
}";
2022-05-11 03:45:50 +00:00
smtp = {
host = serverHostname;
port = 587;
tls.enable = true;
};
};
2022-04-29 02:55:42 +00:00
};
};
2022-05-11 03:45:50 +00:00
programs.fish.shellAbbrs = { hi = "himalaya"; };
2022-04-29 02:55:42 +00:00
};
2022-05-11 03:45:50 +00:00
2022-04-29 02:55:42 +00:00
};
}