1
0
Fork 0
mirror of https://github.com/NotAShelf/neovim-flake.git synced 2024-12-26 09:49:50 +01:00
neovim-flake/lib/types/languages.nix
2023-04-18 00:55:27 +03:00

31 lines
801 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,
diagnostics,
defaultDiagnostics,
}:
mkOption {
description = "List of ${langDesc} diagnostics to enable";
type = with types; listOf (either (enum (attrNames diagnostics)) (submodule diagnosticSubmodule));
default = defaultDiagnostics;
};
mkGrammarOption = pkgs: grammar:
mkPackageOption pkgs ["${grammar} treesitter"] {
default = ["vimPlugins" "nvim-treesitter" "builtGrammars" grammar];
};
}