summaryrefslogtreecommitdiffstats
path: root/modules/plugins/mini/notify/notify.nix
blob: 628be47a08b54732206cb5330b15cc7e97278556 (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
34
35
36
37
38
39
40
41
{
  config,
  lib,
  ...
}: let
  inherit (lib.options) mkEnableOption mkOption;
  inherit (lib.types) int str;
  inherit (lib.nvim.types) mkPluginSetupOption borderType;

  mkNotifyOpt = name: duration: hl_group: {
    duration = mkOption {
      type = int;
      default = duration;
      description = "The duration of the ${name} notification";
    };
    hl_group = mkOption {
      type = str;
      default = hl_group;
      description = "The highlight group of the ${name} notification";
    };
  };
in {
  options.vim.mini.notify = {
    enable = mkEnableOption "mini.notify";
    setupOpts = mkPluginSetupOption "mini.notify" {
      window.config.border = mkOption {
        type = borderType;
        default = config.vim.ui.borders.globalStyle;
        description = "The border type for the mini.notify-notifications";
      };
    };
    notifyOpts = mkPluginSetupOption "mini.notify notifications" {
      ERROR = mkNotifyOpt "error" 5000 "DiagnosticError";
      WARN = mkNotifyOpt "warn" 5000 "DiagnosticWarn";
      INFO = mkNotifyOpt "info" 5000 "DiagnosticInfo";
      DEBUG = mkNotifyOpt "debug" 0 "DiagnosticHint";
      TRACE = mkNotifyOpt "trace" 0 "DiagnosticOk";
      OFF = mkNotifyOpt "off" 0 "MiniNotifyNormal";
    };
  };
}