diff options
author | Nick Hu <me@nickhu.co.uk> | 2019-04-09 18:34:44 +0100 |
---|---|---|
committer | Robert Helgesson <robert@rycee.net> | 2019-04-29 00:05:02 +0200 |
commit | 2f819d1647d4c73aad6ca8fec8348beaae4bb870 (patch) | |
tree | 4ddc4809637ba3c7bd36f118278b2b3e5f130e3d /modules/services/imapnotify-accounts.nix | |
parent | 821df406c9726270bf6faf35be95c56593080711 (diff) |
imapnotify: add service
Diffstat (limited to 'modules/services/imapnotify-accounts.nix')
-rw-r--r-- | modules/services/imapnotify-accounts.nix | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/modules/services/imapnotify-accounts.nix b/modules/services/imapnotify-accounts.nix new file mode 100644 index 00000000000..75b3ecd1ea5 --- /dev/null +++ b/modules/services/imapnotify-accounts.nix @@ -0,0 +1,30 @@ +{ lib, ... }: + +with lib; + +{ + options.imapnotify = { + enable = mkEnableOption "imapnotify"; + + onNotify = mkOption { + type = with types; either str (attrsOf str); + default = ""; + example = "\${pkgs.mbsync}/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."; + }; + }; +} |