2023-07-15 20:53:43 +02:00
|
|
|
{ pkgs, lib, ... }:
|
2019-04-09 19:34:44 +02:00
|
|
|
|
|
|
|
with lib;
|
|
|
|
|
|
|
|
{
|
|
|
|
options.imapnotify = {
|
2023-07-01 01:30:13 +02:00
|
|
|
enable = mkEnableOption (lib.mdDoc "imapnotify");
|
2019-04-09 19:34:44 +02:00
|
|
|
|
|
|
|
onNotify = mkOption {
|
|
|
|
type = with types; either str (attrsOf str);
|
|
|
|
default = "";
|
2019-09-10 21:01:47 +02:00
|
|
|
example = "\${pkgs.isync}/bin/mbsync test-%s";
|
2023-07-01 01:30:13 +02:00
|
|
|
description = lib.mdDoc "Shell commands to run on any event.";
|
2019-04-09 19:34:44 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
onNotifyPost = mkOption {
|
|
|
|
type = with types; either str (attrsOf str);
|
|
|
|
default = "";
|
2020-02-02 00:39:17 +01:00
|
|
|
example = {
|
|
|
|
mail =
|
|
|
|
"\${pkgs.notmuch}/bin/notmuch new && \${pkgs.libnotify}/bin/notify-send 'New mail arrived'";
|
|
|
|
};
|
2023-07-01 01:30:13 +02:00
|
|
|
description = lib.mdDoc "Shell commands to run after onNotify event.";
|
2019-04-09 19:34:44 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
boxes = mkOption {
|
|
|
|
type = types.listOf types.str;
|
2020-02-02 00:39:17 +01:00
|
|
|
default = [ ];
|
2019-04-09 19:34:44 +02:00
|
|
|
example = [ "Inbox" "[Gmail]/MyLabel" ];
|
2023-07-01 01:30:13 +02:00
|
|
|
description = lib.mdDoc "IMAP folders to watch.";
|
2019-04-09 19:34:44 +02:00
|
|
|
};
|
2021-10-18 09:34:51 +02:00
|
|
|
|
|
|
|
extraConfig = mkOption {
|
2023-07-15 20:53:43 +02:00
|
|
|
type = let jsonFormat = pkgs.formats.json { }; in jsonFormat.type;
|
2021-10-18 09:34:51 +02:00
|
|
|
default = { };
|
|
|
|
example = { wait = 10; };
|
2023-07-01 01:30:13 +02:00
|
|
|
description =
|
|
|
|
lib.mdDoc "Additional configuration to add for this account.";
|
2021-10-18 09:34:51 +02:00
|
|
|
};
|
2019-04-09 19:34:44 +02:00
|
|
|
};
|
|
|
|
}
|