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