Files
azos/features/mail/default.nix
T
aner ac6c15f931 Set real mail accounts and tie presence check to the yubikey toggle
Mirrors the azos-core change: features/mail/default.nix now just sets
accounts.email.accounts (the three real addresses, with the existing
default_account_params/default_gmail_params convenience merging kept
here since it's personal boilerplate, not mechanism) and
azos.mail.presenceCheckCommand, wired to azos-card-present only when
azos.encryption.yubikey.enable is true.
2026-10-13 10:03:48 +03:00

73 lines
1.9 KiB
Nix

{...}: {
config.flake.modules.homeManager.mail = {
lib,
config,
pkgs,
...
}: let
default_account_params = {
realName = "Aner Zakobar";
mbsync = {
enable = true;
create = "maildir";
remove = "both";
expunge = "both";
};
msmtp.enable = true;
};
default_gmail_params =
default_account_params
// {
flavor = "gmail.com";
};
default_smtp = {
tls = {
enable = true;
useStartTls = true;
certificatesFile = "/etc/ssl/certs/ca-certificates.crt";
};
};
in {
config = {
azos.mail.enable = true;
# mbsync's PassCmd shells out to `pass`, which needs the GPG smartcard to
# decrypt -- only meaningful to gate on when the smartcard/YubiKey setup
# is actually in play.
azos.mail.presenceCheckCommand = lib.mkIf config.azos.encryption.yubikey.enable "${pkgs.azos-card-present}/bin/azos-card-present";
accounts.email.accounts = {
gmail =
default_gmail_params
// {
address = "anerisgreat@gmail.com";
userName = "anerisgreat";
passwordCommand = "pass mbsync/anerisgreat@gmail.com | head -1";
};
bgu =
default_gmail_params
// {
address = "anerz@post.bgu.ac.il";
userName = "anerz@post.bgu.ac.il";
passwordCommand = "pass mbsync/anerz@post.bgu.ac.il | head -1";
};
zakobar =
default_account_params
// {
address = "aner@zakobar.com";
primary = true;
userName = "aner@zakobar.com";
imap = {host = "mail.privateemail.com";};
smtp =
default_smtp
// {
port = 587;
host = "mail.privateemail.com";
};
passwordCommand = "pass privateemail.com | head -1";
};
};
};
};
}