aboutsummaryrefslogtreecommitdiff
path: root/modules/services/imapnotify-accounts.nix
blob: 94bdce5dfb4669641cbd98a74467f426dd4d926b (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
{ lib, ... }:

with lib;

{
  options.imapnotify = {
    enable = mkEnableOption "imapnotify";

    onNotify = mkOption {
      type = with types; either str (attrsOf str);
      default = "";
      example = "\${pkgs.isync}/bin/mbsync test-%s";
      description = "Shell commands to run on any event.";
    };

    onNotifyPost = mkOption {
      type = with types; either str (attrsOf str);
      default = "";
      example = {
        mail =
          "\${pkgs.notmuch}/bin/notmuch new && \${pkgs.libnotify}/bin/notify-send 'New mail arrived'";
      };
      description = "Shell commands to run after onNotify event.";
    };

    boxes = mkOption {
      type = types.listOf types.str;
      default = [ ];
      example = [ "Inbox" "[Gmail]/MyLabel" ];
      description = "IMAP folders to watch.";
    };
  };
}