fork/home-manager

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

Ryan Lahfanotmuch & neomutt: Control virtualboxes being set in NeoMutt for Notmuch integration (#3143)0263da49

master
2.1 KiB84 linesraw
1{ config, lib, ... }:
2
3with lib;
4
5let
6  extraMailboxOptions = {
7    options = {
8      mailbox = mkOption {
9        type = types.str;
10        example = "Sent";
11        description = "Name of mailbox folder to be included";
12      };
13
14      name = mkOption {
15        type = types.nullOr types.str;
16        example = "Junk";
17        default = null;
18        description = "Name to display";
19      };
20    };
21  };
22
23in {
24  options.notmuch.neomutt = {
25    enable = mkEnableOption "Notmuch support in NeoMutt" // { default = true; };
26
27    virtualMailboxes = mkOption {
28      type = types.listOf (types.submodule ./notmuch-virtual-mailbox.nix);
29      example = [{
30        name = "My INBOX";
31        query = "tag:inbox";
32      }];
33      default = [{
34        name = "My INBOX";
35        query = "tag:inbox";
36      }];
37      description = "List of virtual mailboxes using Notmuch queries";
38    };
39  };
40
41  options.neomutt = {
42    enable = mkEnableOption "NeoMutt";
43
44    sendMailCommand = mkOption {
45      type = types.nullOr types.str;
46      default = if config.msmtp.enable then
47        "msmtpq --read-envelope-from --read-recipients"
48      else
49        null;
50      defaultText = literalExpression ''
51        if config.msmtp.enable then
52          "msmtpq --read-envelope-from --read-recipients"
53        else
54          null
55      '';
56      example = "msmtpq --read-envelope-from --read-recipients";
57      description = ''
58        Command to send a mail. If not set, neomutt will be in charge of sending mails.
59      '';
60    };
61
62    extraConfig = mkOption {
63      type = types.lines;
64      default = "";
65      example = "color status cyan default";
66      description = ''
67        Extra lines to add to the folder hook for this account.
68      '';
69    };
70
71    mailboxName = mkOption {
72      type = types.nullOr types.str;
73      default = null;
74      example = "==== <mailbox-name> ===";
75      description = "Use a different name as mailbox name";
76    };
77
78    extraMailboxes = mkOption {
79      type = with types; listOf (either str (submodule extraMailboxOptions));
80      default = [ ];
81      description = "List of extra mailboxes";
82    };
83  };
84}