1
0
Fork 0
mirror of https://github.com/nix-community/nixvim.git synced 2025-12-08 18:11:07 +01:00
nixvim/modules/diagnostic.nix
2025-12-07 23:34:03 +00:00

27 lines
552 B
Nix

{
lib,
config,
...
}:
let
cfg = config.diagnostic;
in
{
options.diagnostic = {
settings = lib.mkOption {
type = with lib.types; attrsOf anything;
default = { };
description = "The configuration diagnostic options, provided to `vim.diagnostic.config`.";
example = {
virtual_text = false;
virtual_lines.current_line = true;
};
};
};
config = {
extraConfigLuaPre = lib.mkIf (cfg.settings != { }) ''
vim.diagnostic.config(${lib.nixvim.toLuaObject cfg.settings})
'';
};
}