feat: apply new module format to notification plugins

This commit is contained in:
NotAShelf 2023-02-27 22:26:31 +03:00
commit 4d1e7bcbe6
No known key found for this signature in database
GPG key ID: 5B5C8895F28445F1
5 changed files with 83 additions and 35 deletions

View file

@ -0,0 +1,31 @@
{
pkgs,
config,
lib,
...
}:
with lib;
with builtins; let
cfg = config.vim.notify.nvim-notify;
in {
config = mkIf cfg.enable {
vim.startPlugins = ["nvim-notify"];
vim.luaConfigRC.nvim-notify = nvim.dag.entryAnywhere ''
require('notify').setup {
stages = "${cfg.stages}",
timeout = ${toString cfg.timeout},
background_colour = "${cfg.background_colour}",
position = "${cfg.position}",
icons = {
ERROR = "${cfg.icons.ERROR}",
WARN = "${cfg.icons.WARN}",
INFO = "${cfg.icons.INFO}",
DEBUG = "${cfg.icons.DEBUG}",
TRACE = "${cfg.icons.TRACE}",
},
}
'';
};
}