mirror of
https://github.com/nix-community/nixvim.git
synced 2025-06-21 00:25:42 +02:00
notify: init plugin
This commit is contained in:
parent
382878e47c
commit
bb2a9a9496
2 changed files with 74 additions and 0 deletions
|
@ -31,6 +31,7 @@
|
|||
./utils/intellitab.nix
|
||||
./utils/specs.nix
|
||||
./utils/mark-radar.nix
|
||||
./utils/notify.nix
|
||||
|
||||
./languages/treesitter.nix
|
||||
./languages/nix.nix
|
||||
|
|
73
plugins/utils/notify.nix
Normal file
73
plugins/utils/notify.nix
Normal file
|
@ -0,0 +1,73 @@
|
|||
{ pkgs, config, lib, ... }:
|
||||
with lib;
|
||||
let
|
||||
cfg = config.programs.nixvim.plugins.notify;
|
||||
helpers = import ../helpers.nix { lib = lib; };
|
||||
icon = mkOption {
|
||||
type = types.nullOr types.str;
|
||||
default = null;
|
||||
};
|
||||
in
|
||||
{
|
||||
options.programs.nixvim.plugins.notify = {
|
||||
enable = mkEnableOption "Enable notify";
|
||||
|
||||
stages = mkOption {
|
||||
type = types.nullOr (types.enum [ "fade_in_slide_out" "fade" "slide" "static" ]);
|
||||
description = "Animation style";
|
||||
default = null;
|
||||
};
|
||||
timeout = mkOption {
|
||||
type = types.nullOr types.int;
|
||||
description = "Default timeout for notifications";
|
||||
default = null;
|
||||
};
|
||||
backgroundColor = mkOption {
|
||||
type = types.nullOr types.str;
|
||||
description = "For stages that change opacity this is treated as the highlight between the window";
|
||||
default = null;
|
||||
};
|
||||
minimumWidth = mkOption {
|
||||
type = types.nullOr types.int;
|
||||
description = "Minimum width for notification windows";
|
||||
default = null;
|
||||
};
|
||||
icons = mkOption {
|
||||
type = types.nullOr (types.submodule {
|
||||
options = {
|
||||
error = icon;
|
||||
warn = icon;
|
||||
info = icon;
|
||||
debug = icon;
|
||||
trace = icon;
|
||||
};
|
||||
});
|
||||
description = "Icons for the different levels";
|
||||
default = {};
|
||||
};
|
||||
};
|
||||
|
||||
config = let
|
||||
setupOptions = with cfg; {
|
||||
stages = stages;
|
||||
timeout = timeout;
|
||||
background_color = backgroundColor;
|
||||
minimum_width = minimumWidth;
|
||||
icons = with icons; {
|
||||
ERROR = error;
|
||||
WARN = warn;
|
||||
INFO = info;
|
||||
DEBUG = debug;
|
||||
TRACE = trace;
|
||||
};
|
||||
};
|
||||
in mkIf cfg.enable {
|
||||
programs.nixvim = {
|
||||
extraPlugins = [ pkgs.vimPlugins.nvim-notify ];
|
||||
extraConfigLua = ''
|
||||
vim.notify = require('notify');
|
||||
require('notify').setup(${helpers.toLuaObject setupOptions})
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue