2019-02-05 07:03:04 +01:00
|
|
|
pkgs:
|
2018-08-06 12:05:46 +02:00
|
|
|
{ config, lib, ... }:
|
|
|
|
|
|
|
|
with lib;
|
|
|
|
|
|
|
|
{
|
|
|
|
options.alot = {
|
|
|
|
sendMailCommand = mkOption {
|
|
|
|
type = types.nullOr types.str;
|
2023-07-02 01:45:18 +02:00
|
|
|
description = ''
|
2018-08-06 12:05:46 +02:00
|
|
|
Command to send a mail. If msmtp is enabled for the account,
|
|
|
|
then this is set to
|
2023-07-01 01:30:13 +02:00
|
|
|
{command}`msmtpq --read-envelope-from --read-recipients`.
|
2018-08-06 12:05:46 +02:00
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
2019-02-05 07:03:04 +01:00
|
|
|
contactCompletion = mkOption {
|
|
|
|
type = types.attrsOf types.str;
|
|
|
|
default = {
|
|
|
|
type = "shellcommand";
|
2020-02-02 00:39:17 +01:00
|
|
|
command =
|
|
|
|
"'${pkgs.notmuch}/bin/notmuch address --format=json --output=recipients date:6M..'";
|
|
|
|
regexp = "'\\[?{" + ''
|
|
|
|
"name": "(?P<name>.*)", "address": "(?P<email>.+)", "name-addr": ".*"''
|
2019-04-10 14:39:25 +02:00
|
|
|
+ "}[,\\]]?'";
|
2019-02-05 07:03:04 +01:00
|
|
|
shellcommand_external_filtering = "False";
|
|
|
|
};
|
2021-10-09 11:14:08 +02:00
|
|
|
example = literalExpression ''
|
2019-02-05 07:03:04 +01:00
|
|
|
{
|
|
|
|
type = "shellcommand";
|
|
|
|
command = "abook --mutt-query";
|
|
|
|
regexp = "'^(?P<email>[^@]+@[^\t]+)\t+(?P<name>[^\t]+)'";
|
|
|
|
ignorecase = "True";
|
|
|
|
}
|
|
|
|
'';
|
2023-07-02 01:45:18 +02:00
|
|
|
description = ''
|
2020-02-02 00:39:17 +01:00
|
|
|
Contact completion configuration as expected per alot.
|
2023-07-01 01:30:13 +02:00
|
|
|
See [alot's wiki](http://alot.readthedocs.io/en/latest/configuration/contacts_completion.html) for
|
2020-02-02 00:39:17 +01:00
|
|
|
explanation about possible values.
|
2019-02-05 07:03:04 +01:00
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
2018-08-06 12:05:46 +02:00
|
|
|
extraConfig = mkOption {
|
|
|
|
type = types.lines;
|
|
|
|
default = "";
|
2023-07-02 01:45:18 +02:00
|
|
|
description = ''
|
2018-08-06 12:05:46 +02:00
|
|
|
Extra settings to add to this Alot account configuration.
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
config = mkIf config.notmuch.enable {
|
2020-02-02 00:39:17 +01:00
|
|
|
alot.sendMailCommand = mkOptionDefault (if config.msmtp.enable then
|
|
|
|
"msmtpq --read-envelope-from --read-recipients"
|
|
|
|
else
|
|
|
|
null);
|
2018-08-06 12:05:46 +02:00
|
|
|
};
|
|
|
|
}
|