dotfiles/modules/mail/himalaya.nix

94 lines
2.5 KiB
Nix
Raw Normal View History

2022-05-11 03:45:50 +00:00
{ config, pkgs, lib, ... }: {
options = {
2022-06-20 18:41:36 +00:00
mailUser = lib.mkOption {
type = lib.types.str;
description = "User name for the email address.";
default = config.user;
};
2022-05-11 03:45:50 +00:00
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; };
2022-06-18 17:17:11 +00:00
services.mbsync = lib.mkIf pkgs.stdenv.isLinux {
2022-05-17 02:05:21 +00:00
enable = true;
frequency = "*:0/5";
};
2022-05-11 03:45:50 +00:00
accounts.email = {
2022-07-08 01:31:00 +00:00
maildirBasePath = "${config.homePath}/mail";
2022-05-11 03:45:50 +00:00
accounts = {
2022-06-20 18:41:36 +00:00
home = let address = "${config.mailUser}@${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 = {
2022-06-20 03:44:29 +00:00
downloads-dir = config.userDirs.download;
2022-05-14 21:36:38 +00:00
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 = [ "*" ];
extraConfig.channel = {
CopyArrivalDate = "yes"; # Sync time of original message
};
2022-05-11 03:45:50 +00:00
};
mu.enable = false;
notmuch.enable = false;
passwordCommand =
"${pkgs.age}/bin/age --decrypt --identity ${config.homePath}/.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
};
}