feat: install proton bridge and aerc for email

This commit is contained in:
wi11-holdsworth 2025-09-25 18:23:31 +10:00
parent 1562d5c30b
commit eeae2e69f3
5 changed files with 110 additions and 0 deletions

View file

@ -0,0 +1,20 @@
{
config,
lib,
...
}:
let
feature = "aerc";
in
{
config = lib.mkIf config.${feature}.enable {
programs.aerc = {
enable = true;
extraConfig.general.unsafe-accounts-conf = true;
};
};
imports = [ ];
options.${feature}.enable = lib.mkEnableOption "enables ${feature}";
}

View file

@ -0,0 +1,70 @@
{
config,
lib,
...
}:
let
feature = "mail";
in
{
config = lib.mkIf config.${feature}.enable {
accounts.email =
let
certificatesFile = config.age.secrets.protonmail-cert.path;
in
{
inherit certificatesFile;
accounts =
let
# keep-sorted start block=yes
address = "willholdsworth@pm.me";
authentication = "login";
host = "127.0.0.1";
tls = {
enable = false;
useStartTls = true;
inherit certificatesFile;
};
# keep-sorted end
in
{
personal = {
enable = true;
# keep-sorted start block=yes
aerc = {
enable = true;
};
imap = {
port = 1143;
inherit tls;
inherit authentication;
inherit host;
};
inherit address;
passwordCommand = "cat ${config.age.secrets.protonmail-password.path}";
primary = true;
realName = "Will Holdsworth";
smtp = {
port = 1025;
inherit tls;
inherit authentication;
inherit host;
};
userName = address;
# keep-sorted end
};
};
};
age.secrets = {
# keep-sorted start
"protonmail-cert".file = ../../../secrets/protonmail-cert.age;
"protonmail-password".file = ../../../secrets/protonmail-password.age;
# keep-sorted end
};
};
imports = [ ];
options.${feature}.enable = lib.mkEnableOption "enables ${feature}";
}