dotfiles/modules/mail/himalaya.nix

86 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-18 03:34:09 +00:00
home = let address = "${config.user}@${config.mailServer}";
2022-05-11 03:45:50 +00:00
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 = {
2022-05-18 03:34:09 +00:00
host = "imap.purelymail.com";
2022-05-11 03:45:50 +00:00
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 = {
2022-05-18 03:34:09 +00:00
host = "smtp.purelymail.com";
port = 465;
2022-05-11 03:45:50 +00:00
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
};
}