aboutsummaryrefslogtreecommitdiff
path: root/home-manager/modules/programs/neomutt-accounts.nix
blob: 033db38eb0ac4ede970f70bd5205456a18015d98 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
{ config, lib, ... }:

with lib;

{
  options.neomutt = {
    enable = mkEnableOption "NeoMutt";

    sendMailCommand = mkOption {
      type = types.nullOr types.str;
      default = null;
      example = "msmtpq --read-envelope-from --read-recipients";
      description = ''
        Command to send a mail. If not set, neomutt will be in charge of sending mails.
      '';
    };

    extraConfig = mkOption {
      type = types.lines;
      default = "";
      example = "color status cyan default";
      description = ''
        Extra lines to add to the folder hook for this account.
      '';
    };
  };

  config = mkIf config.neomutt.enable {
    neomutt.sendMailCommand = mkOptionDefault (if config.msmtp.enable then
      "msmtpq --read-envelope-from --read-recipients"
    else
      null);
  };
}