treewide: remove with lib; from docs and sources

This commit is contained in:
raf 2024-11-25 18:11:53 +03:00
commit 7da133c3a1
Signed by: NotAShelf
GPG key ID: AF26552424E53993
2 changed files with 36 additions and 23 deletions

View file

@ -1,31 +1,37 @@
{lib}:
with lib; let
{lib}: let
inherit (lib.options) mkOption mkPackageOption;
inherit (lib.attrsets) attrNames;
inherit (lib.types) listOf either enum submodule package;
diagnosticSubmodule = _: {
options = {
type = mkOption {
description = "Type of diagnostic to enable";
type = attrNames diagnostics;
};
package = mkOption {
type = package;
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));
type = listOf (either (enum (attrNames diagnosticsProviders)) (submodule diagnosticSubmodule));
default = defaultDiagnosticsProvider;
description = "List of ${langDesc} diagnostics to enable";
};
mkGrammarOption = pkgs: grammar:
mkPackageOption pkgs ["${grammar} treesitter"] {
default = ["vimPlugins" "nvim-treesitter" "builtGrammars" grammar];
};
in {
inherit diagnostics diagnosticSubmodule mkGrammarOption;
}