fork/home-manager

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

Genevieveimapnotify: Use JSON type for extraConfig (#4238)f5b03feb

master
1.0 KiB40 linesraw
1{ pkgs, lib, ... }:
2
3with lib;
4
5{
6  options.imapnotify = {
7    enable = mkEnableOption "imapnotify";
8
9    onNotify = mkOption {
10      type = with types; either str (attrsOf str);
11      default = "";
12      example = "\${pkgs.isync}/bin/mbsync test-%s";
13      description = "Shell commands to run on any event.";
14    };
15
16    onNotifyPost = mkOption {
17      type = with types; either str (attrsOf str);
18      default = "";
19      example = {
20        mail =
21          "\${pkgs.notmuch}/bin/notmuch new && \${pkgs.libnotify}/bin/notify-send 'New mail arrived'";
22      };
23      description = "Shell commands to run after onNotify event.";
24    };
25
26    boxes = mkOption {
27      type = types.listOf types.str;
28      default = [ ];
29      example = [ "Inbox" "[Gmail]/MyLabel" ];
30      description = "IMAP folders to watch.";
31    };
32
33    extraConfig = mkOption {
34      type = let jsonFormat = pkgs.formats.json { }; in jsonFormat.type;
35      default = { };
36      example = { wait = 10; };
37      description = "Additional configuration to add for this account.";
38    };
39  };
40}