mirror of
https://github.com/NotAShelf/neovim-flake.git
synced 2024-11-15 06:35:58 +01:00
31 lines
831 B
Nix
31 lines
831 B
Nix
{lib}:
|
|
with lib; let
|
|
diagnosticSubmodule = _: {
|
|
options = {
|
|
type = mkOption {
|
|
description = "Type of diagnostic to enable";
|
|
type = attrNames diagnostics;
|
|
};
|
|
package = mkOption {
|
|
description = "Diagnostics package";
|
|
type = types.package;
|
|
};
|
|
};
|
|
};
|
|
in {
|
|
diagnostics = {
|
|
langDesc,
|
|
diagnosticsProviders,
|
|
defaultDiagnosticsProvider,
|
|
}:
|
|
mkOption {
|
|
description = "List of ${langDesc} diagnostics to enable";
|
|
type = with types; listOf (either (enum (attrNames diagnosticsProviders)) (submodule diagnosticSubmodule));
|
|
default = defaultDiagnosticsProvider;
|
|
};
|
|
|
|
mkGrammarOption = pkgs: grammar:
|
|
mkPackageOption pkgs ["${grammar} treesitter"] {
|
|
default = ["vimPlugins" "nvim-treesitter" "builtGrammars" grammar];
|
|
};
|
|
}
|