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} = {
|
|
|
|
|
2022-05-12 01:08:16 +00:00
|
|
|
home.packages = with pkgs; [ age ];
|
|
|
|
|
2022-05-11 03:45:50 +00:00
|
|
|
programs.himalaya = { enable = true; };
|
|
|
|
|
|
|
|
accounts.email = {
|
|
|
|
maildirBasePath = "/home/${config.user}/mail";
|
|
|
|
accounts = {
|
|
|
|
main = let
|
|
|
|
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 = {
|
|
|
|
enable = false;
|
|
|
|
create = "maildir";
|
|
|
|
expunge = "none";
|
|
|
|
remove = "none";
|
|
|
|
patterns = [ "*" ];
|
|
|
|
};
|
|
|
|
mu.enable = false;
|
|
|
|
notmuch.enable = false;
|
|
|
|
passwordCommand =
|
2022-05-12 01:08:16 +00:00
|
|
|
"${pkgs.age}/bin/age --decrypt --identity /home/${config.user}/.ssh/id_rsa ${
|
|
|
|
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
|
|
|
};
|
|
|
|
}
|