2022-08-11 21:08:28 +00:00
|
|
|
{ config, lib, pkgs, ... }:
|
|
|
|
|
|
|
|
with lib;
|
|
|
|
|
|
|
|
{
|
|
|
|
config = {
|
2023-10-22 08:49:52 +00:00
|
|
|
nmt.script = let
|
2023-10-26 06:27:37 +00:00
|
|
|
dir = if (pkgs.stdenv.isDarwin && !config.xdg.enable) then
|
2023-10-22 08:49:52 +00:00
|
|
|
"home-files/Library/Preferences/aerc"
|
|
|
|
else
|
|
|
|
"home-files/.config/aerc";
|
2022-08-11 21:08:28 +00:00
|
|
|
in ''
|
|
|
|
assertFileContent ${dir}/accounts.conf ${./extraAccounts.expected}
|
|
|
|
assertFileContent ${dir}/binds.conf ${./extraBinds.expected}
|
|
|
|
assertFileContent ${dir}/aerc.conf ${./extraConfig.expected}
|
|
|
|
assertFileContent ${dir}/templates/bar ${./templates.expected}
|
|
|
|
assertFileContent ${dir}/templates/foo ${./templates.expected}
|
|
|
|
assertFileContent ${dir}/stylesets/default ${./stylesets.expected}
|
|
|
|
assertFileContent ${dir}/stylesets/asLines ${./stylesets.expected}
|
|
|
|
'';
|
|
|
|
|
|
|
|
test.stubs.aerc = { };
|
|
|
|
|
|
|
|
programs.aerc = {
|
|
|
|
enable = true;
|
|
|
|
|
|
|
|
extraAccounts = {
|
|
|
|
Test1 = {
|
|
|
|
source = "maildir:///dev/null";
|
|
|
|
enable-folders-sort = true;
|
|
|
|
folders = [ "INBOX" "SENT" "JUNK" ];
|
|
|
|
};
|
|
|
|
Test2 = { pgp-key-id = 42; };
|
|
|
|
};
|
|
|
|
|
|
|
|
extraBinds = {
|
|
|
|
global = {
|
|
|
|
"<C-p>" = ":prev-tab<Enter>";
|
|
|
|
"<C-n>" = ":next-tab<Enter>";
|
|
|
|
"<C-t>" = ":term<Enter>";
|
|
|
|
};
|
|
|
|
messages = {
|
|
|
|
q = ":quit<Enter>";
|
|
|
|
j = ":next<Enter>";
|
|
|
|
};
|
|
|
|
"compose::editor" = {
|
|
|
|
"$noinherit" = "true";
|
|
|
|
"$ex" = "<C-x>";
|
|
|
|
"<C-k>" = ":prev-field<Enter>";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
extraConfig = {
|
|
|
|
general.unsafe-accounts-conf = true;
|
|
|
|
ui = {
|
|
|
|
index-format = null;
|
|
|
|
sort = "-r date";
|
|
|
|
spinner = [ true 2 3.4 "5" ];
|
|
|
|
sidebar-width = 42;
|
|
|
|
mouse-enabled = false;
|
|
|
|
test-float = 1337.42;
|
|
|
|
};
|
|
|
|
"ui:account=Test" = { sidebar-width = 1337; };
|
|
|
|
};
|
|
|
|
|
|
|
|
stylesets = {
|
|
|
|
asLines = ''
|
|
|
|
*.default = true
|
|
|
|
*.selected.reverse = toggle
|
|
|
|
*error.bold = true
|
|
|
|
error.fg = red
|
|
|
|
header.bold = true
|
|
|
|
title.reverse = true
|
|
|
|
'';
|
|
|
|
default = {
|
|
|
|
"*.default" = "true";
|
|
|
|
"*error.bold" = "true";
|
|
|
|
"error.fg" = "red";
|
|
|
|
"header.bold" = "true";
|
|
|
|
"*.selected.reverse" = "toggle";
|
|
|
|
"title.reverse" = "true";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
templates = rec {
|
|
|
|
foo = ''
|
|
|
|
X-Mailer: aerc {{version}}
|
|
|
|
|
|
|
|
Just a test.
|
|
|
|
'';
|
|
|
|
bar = foo;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
accounts.email.accounts = let
|
|
|
|
basics = {
|
|
|
|
aerc = { enable = true; };
|
|
|
|
realName = "Foo Bar";
|
|
|
|
userName = "foobar";
|
|
|
|
address = "addr@mail.invalid";
|
|
|
|
folders = {
|
|
|
|
drafts = "";
|
|
|
|
inbox = "";
|
|
|
|
sent = "";
|
|
|
|
trash = "";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
in {
|
2023-06-13 08:59:42 +00:00
|
|
|
primary = basics // {
|
2022-08-11 21:08:28 +00:00
|
|
|
primary = true;
|
|
|
|
imap = {
|
|
|
|
host = "imap.host.invalid";
|
|
|
|
port = 1337;
|
|
|
|
tls.enable = true;
|
|
|
|
tls.useStartTls = true;
|
|
|
|
};
|
2023-06-13 08:59:42 +00:00
|
|
|
};
|
|
|
|
a_imap-nopasscmd-tls-starttls-folders = basics // {
|
|
|
|
imap = {
|
|
|
|
host = "imap.host.invalid";
|
|
|
|
port = 1337;
|
|
|
|
tls.enable = true;
|
|
|
|
tls.useStartTls = true;
|
|
|
|
};
|
2022-08-11 21:08:28 +00:00
|
|
|
folders = {
|
|
|
|
drafts = "aercDrafts";
|
|
|
|
inbox = "aercInbox";
|
|
|
|
sent = "aercSent";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
b_imap-passcmd-tls-nostarttls-extraAccounts = basics // {
|
|
|
|
passwordCommand = "echo PaSsWorD!";
|
|
|
|
imap = {
|
|
|
|
host = "imap.host.invalid";
|
|
|
|
port = 1337;
|
|
|
|
tls.enable = true;
|
|
|
|
tls.useStartTls = false;
|
|
|
|
};
|
|
|
|
aerc = {
|
|
|
|
enable = true;
|
|
|
|
extraAccounts = { connection-timeout = "42s"; };
|
|
|
|
};
|
|
|
|
};
|
|
|
|
c_imap-passcmd-notls-nostarttls-extraConfig = basics // {
|
|
|
|
passwordCommand = "echo PaSsWorD!";
|
|
|
|
aerc = {
|
|
|
|
enable = true;
|
|
|
|
extraConfig = { ui.index-format = "%42.1337n"; };
|
|
|
|
};
|
|
|
|
imap = {
|
|
|
|
host = "imap.host.invalid";
|
|
|
|
port = 1337;
|
|
|
|
tls.enable = false;
|
|
|
|
tls.useStartTls = false;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
d_imap-passcmd-notls-starttls-extraBinds = basics // {
|
|
|
|
passwordCommand = "echo PaSsWorD!";
|
|
|
|
imap = {
|
|
|
|
host = "imap.host.invalid";
|
|
|
|
port = 1337;
|
|
|
|
tls.enable = false;
|
|
|
|
tls.useStartTls = true;
|
|
|
|
};
|
|
|
|
aerc = {
|
|
|
|
enable = true;
|
|
|
|
extraBinds = { messages = { d = ":move Trash<Enter>"; }; };
|
|
|
|
};
|
|
|
|
};
|
|
|
|
e_smtp-nopasscmd-tls-starttls = basics // {
|
|
|
|
smtp = {
|
|
|
|
host = "smtp.host.invalid";
|
|
|
|
port = 42;
|
|
|
|
tls.enable = true;
|
|
|
|
tls.useStartTls = true;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
f_smtp-passcmd-tls-nostarttls = basics // {
|
|
|
|
passwordCommand = "echo PaSsWorD!";
|
|
|
|
smtp = {
|
|
|
|
host = "smtp.host.invalid";
|
|
|
|
port = 42;
|
|
|
|
tls.enable = true;
|
|
|
|
tls.useStartTls = false;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
g_smtp-passcmd-notls-nostarttls = basics // {
|
|
|
|
passwordCommand = "echo PaSsWorD!";
|
|
|
|
smtp = {
|
|
|
|
host = "smtp.host.invalid";
|
|
|
|
port = 42;
|
|
|
|
tls.enable = false;
|
|
|
|
tls.useStartTls = false;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
h_smtp-passcmd-notls-starttls = basics // {
|
|
|
|
passwordCommand = "echo PaSsWorD!";
|
|
|
|
smtp = {
|
|
|
|
host = "smtp.host.invalid";
|
|
|
|
port = 42;
|
|
|
|
tls.enable = false;
|
|
|
|
tls.useStartTls = true;
|
|
|
|
};
|
|
|
|
};
|
2023-12-22 17:14:39 +00:00
|
|
|
i1_maildir-mbsync = basics // { mbsync.enable = true; };
|
|
|
|
i2_maildirpp-mbsync = basics // {
|
|
|
|
mbsync.enable = true;
|
|
|
|
mbsync.subFolders = "Maildir++";
|
|
|
|
};
|
|
|
|
i3_maildir_flatten-mbsync = basics // {
|
|
|
|
mbsync.enable = true;
|
|
|
|
mbsync.subFolders = "Maildir++";
|
|
|
|
mbsync.flatten = ".";
|
|
|
|
};
|
2022-08-11 21:08:28 +00:00
|
|
|
j_maildir-offlineimap = basics // { offlineimap.enable = true; };
|
|
|
|
k_notEnabled = basics // { aerc.enable = false; };
|
2023-01-24 10:30:04 +00:00
|
|
|
l_smtp-auth-none = basics // {
|
2022-08-11 21:08:28 +00:00
|
|
|
smtp = {
|
|
|
|
host = "smtp.host.invalid";
|
|
|
|
port = 42;
|
|
|
|
};
|
|
|
|
aerc = {
|
|
|
|
enable = true;
|
|
|
|
smtpAuth = "none";
|
|
|
|
};
|
|
|
|
};
|
2023-01-24 10:30:04 +00:00
|
|
|
m_smtp-auth-plain = basics // {
|
2022-08-11 21:08:28 +00:00
|
|
|
smtp = {
|
|
|
|
host = "smtp.host.invalid";
|
|
|
|
port = 42;
|
|
|
|
};
|
|
|
|
aerc = {
|
|
|
|
enable = true;
|
|
|
|
smtpAuth = "plain";
|
|
|
|
};
|
|
|
|
};
|
2023-01-24 10:30:04 +00:00
|
|
|
n_smtp-auth-login = basics // {
|
2022-08-11 21:08:28 +00:00
|
|
|
smtp = {
|
|
|
|
host = "smtp.host.invalid";
|
|
|
|
port = 42;
|
|
|
|
};
|
|
|
|
aerc = {
|
|
|
|
enable = true;
|
|
|
|
smtpAuth = "login";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
o_msmtp = basics // { msmtp = { enable = true; }; };
|
2023-06-13 08:59:42 +00:00
|
|
|
p_overwrite_defaults = basics // {
|
|
|
|
smtp.host = "should.be.overwritten.invalid";
|
|
|
|
imap.host = "should.be.overwritten.invalid";
|
|
|
|
aerc = {
|
|
|
|
enable = true;
|
|
|
|
extraAccounts = {
|
|
|
|
from = "test <test@email.invalid>";
|
|
|
|
outgoing =
|
|
|
|
"imap+plain://intentionallyWrong:PaSsWorD@smtp.host.invalid:1337";
|
|
|
|
source =
|
|
|
|
"smtp+plain://intentionallyWrong:PaSsWorD@smtp.host.invalid:1337";
|
|
|
|
postpone = "dRaFts";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
2022-08-11 21:08:28 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|