2024-04-26 23:21:27 +02:00
|
|
|
{lib, ...}: let
|
2024-03-10 21:41:33 +01:00
|
|
|
inherit (lib.options) mkEnableOption mkOption;
|
|
|
|
inherit (lib.modules) mkRenamedOptionModule;
|
2024-04-26 23:21:27 +02:00
|
|
|
inherit (lib.types) int str enum attrsOf either;
|
|
|
|
inherit (lib.nvim.types) mkPluginSetupOption luaInline;
|
2023-11-07 01:50:27 +01:00
|
|
|
in {
|
2024-03-10 21:41:33 +01:00
|
|
|
imports = let
|
|
|
|
renamedSetupOpt = name:
|
|
|
|
mkRenamedOptionModule
|
|
|
|
["vim" "notify" "nvim-notify" name]
|
|
|
|
["vim" "notify" "nvim-notify" "setupOpts" name];
|
|
|
|
in [
|
|
|
|
(renamedSetupOpt "stages")
|
|
|
|
(renamedSetupOpt "timeout")
|
|
|
|
(renamedSetupOpt "background_colour")
|
|
|
|
(renamedSetupOpt "position")
|
|
|
|
(renamedSetupOpt "icons")
|
|
|
|
];
|
|
|
|
|
2023-04-03 11:12:05 +02:00
|
|
|
options.vim.notify.nvim-notify = {
|
2023-06-05 22:10:25 +02:00
|
|
|
enable = mkEnableOption "nvim-notify notifications";
|
|
|
|
|
2024-03-10 21:41:33 +01:00
|
|
|
setupOpts = mkPluginSetupOption "nvim-notify" {
|
2024-04-26 23:21:27 +02:00
|
|
|
render = mkOption {
|
|
|
|
type = either (enum ["default" "minimal" "simple" "compact" "wrapped-compact"]) luaInline;
|
|
|
|
default = "compact";
|
|
|
|
description = "Custom rendering method to be used for displaying notifications";
|
|
|
|
};
|
|
|
|
|
2024-03-10 21:41:33 +01:00
|
|
|
stages = mkOption {
|
2024-12-20 16:27:44 +01:00
|
|
|
type = enum ["fade_in_slide_out" "fade" "slide" "static"];
|
2024-03-10 21:41:33 +01:00
|
|
|
default = "fade_in_slide_out";
|
|
|
|
description = "The stages of the notification";
|
|
|
|
};
|
2023-06-05 22:10:25 +02:00
|
|
|
|
2024-03-10 21:41:33 +01:00
|
|
|
timeout = mkOption {
|
|
|
|
type = int;
|
|
|
|
default = 1000;
|
|
|
|
description = "The timeout of the notification";
|
|
|
|
};
|
2023-06-05 22:10:25 +02:00
|
|
|
|
2024-03-10 21:41:33 +01:00
|
|
|
background_colour = mkOption {
|
|
|
|
type = str;
|
2024-12-20 16:27:44 +01:00
|
|
|
default = "NotifyBackground";
|
2024-03-10 21:41:33 +01:00
|
|
|
description = "The background colour of the notification";
|
|
|
|
};
|
|
|
|
|
|
|
|
position = mkOption {
|
|
|
|
type = enum ["top_left" "top_right" "bottom_left" "bottom_right"];
|
|
|
|
default = "top_right";
|
|
|
|
description = "The position of the notification";
|
|
|
|
};
|
2023-06-05 22:10:25 +02:00
|
|
|
|
2024-03-10 21:41:33 +01:00
|
|
|
icons = mkOption {
|
|
|
|
type = attrsOf str;
|
|
|
|
description = "The icons of the notification";
|
|
|
|
default = {
|
|
|
|
ERROR = "";
|
|
|
|
WARN = "";
|
|
|
|
INFO = "";
|
|
|
|
DEBUG = "";
|
2024-04-26 23:21:27 +02:00
|
|
|
TRACE = "";
|
2024-03-10 21:41:33 +01:00
|
|
|
};
|
2023-04-03 11:12:05 +02:00
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|