fork/home-manager

git clone https://git.julia.blue/fork/home-manager

Robert HelgessonMerge PR #421575790441

master
1.6 KiB58 linesraw
1pkgs:
2{ config, lib, ... }:
3
4with lib;
5
6{
7  options.alot = {
8    sendMailCommand = mkOption {
9      type = types.nullOr types.str;
10      description = ''
11        Command to send a mail. If msmtp is enabled for the account,
12        then this is set to
13        {command}`msmtpq --read-envelope-from --read-recipients`.
14      '';
15    };
16
17    contactCompletion = mkOption {
18      type = types.attrsOf types.str;
19      default = {
20        type = "shellcommand";
21        command =
22          "'${pkgs.notmuch}/bin/notmuch address --format=json --output=recipients  date:6M..'";
23        regexp = "'\\[?{" + ''
24          "name": "(?P<name>.*)", "address": "(?P<email>.+)", "name-addr": ".*"''
25          + "}[,\\]]?'";
26        shellcommand_external_filtering = "False";
27      };
28      example = literalExpression ''
29        {
30          type = "shellcommand";
31          command = "abook --mutt-query";
32          regexp = "'^(?P<email>[^@]+@[^\t]+)\t+(?P<name>[^\t]+)'";
33          ignorecase = "True";
34        }
35      '';
36      description = ''
37        Contact completion configuration as expected per alot.
38        See [alot's wiki](http://alot.readthedocs.io/en/latest/configuration/contacts_completion.html) for
39        explanation about possible values.
40      '';
41    };
42
43    extraConfig = mkOption {
44      type = types.lines;
45      default = "";
46      description = ''
47        Extra settings to add to this Alot account configuration.
48      '';
49    };
50  };
51
52  config = mkIf config.notmuch.enable {
53    alot.sendMailCommand = mkOptionDefault (if config.msmtp.enable then
54      "msmtpq --read-envelope-from --read-recipients"
55    else
56      null);
57  };
58}