2023-05-30 22:29:05 +02:00
|
|
|
{ config, inputs, lib, ... }:
|
|
|
|
let
|
|
|
|
cfg = config.programs.az-email;
|
|
|
|
in
|
2022-11-04 19:06:14 +01:00
|
|
|
{
|
2023-05-30 22:29:05 +02:00
|
|
|
options = {
|
2023-05-30 22:43:49 +02:00
|
|
|
programs.az-email.enable = lib.mkEnableOption "Configure everything required for sending emails.";
|
2023-05-30 22:29:05 +02:00
|
|
|
};
|
2022-11-04 19:06:14 +01:00
|
|
|
|
2023-05-30 22:29:05 +02:00
|
|
|
config = lib.mkIf cfg.enable {
|
|
|
|
age.secrets.personalEmailKey =
|
|
|
|
{
|
|
|
|
file = "${inputs.self}/scrts/personal_email.key.age";
|
|
|
|
mode = "600";
|
|
|
|
owner = config.az-username;
|
|
|
|
group = "users";
|
2022-11-04 19:06:14 +01:00
|
|
|
};
|
2023-05-30 22:29:05 +02:00
|
|
|
|
|
|
|
home-manager.users.${config.az-username} = {
|
|
|
|
accounts.email.accounts."personal" = {
|
|
|
|
address = "andreas@zweili.ch";
|
|
|
|
realName = "Andreas Zweili";
|
|
|
|
userName = "andreas@zweili.ch";
|
|
|
|
primary = true;
|
|
|
|
passwordCommand = "cat ${config.age.secrets.personalEmailKey.path}";
|
|
|
|
aliases = [
|
|
|
|
"andreas.zweili@gmail.com"
|
|
|
|
"andreas@2li.ch"
|
|
|
|
];
|
|
|
|
msmtp.enable = true;
|
|
|
|
mu.enable = true;
|
|
|
|
offlineimap = {
|
|
|
|
enable = true;
|
|
|
|
extraConfig = {
|
|
|
|
account = { autorefresh = 15; };
|
|
|
|
local = { sync_deletes = true; };
|
|
|
|
};
|
|
|
|
};
|
|
|
|
imap = {
|
|
|
|
host = "mail.zweili.org";
|
|
|
|
port = 993;
|
|
|
|
tls.enable = true;
|
|
|
|
};
|
|
|
|
smtp = {
|
|
|
|
host = "mail.zweili.org";
|
|
|
|
port = 465;
|
|
|
|
tls.enable = true;
|
|
|
|
};
|
2022-11-04 19:06:14 +01:00
|
|
|
};
|
2023-05-30 22:29:05 +02:00
|
|
|
programs.mu.enable = true;
|
|
|
|
programs.offlineimap.enable = true;
|
|
|
|
programs.msmtp.enable = true;
|
2022-11-04 19:06:14 +01:00
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|