plugins/treesitter: use mkPackageOption

This commit is contained in:
Matt Sturgeon 2024-09-03 14:48:47 +01:00
parent 2132702a47
commit e26f044339
No known key found for this signature in database
GPG key ID: 4F91844CED1A8299

View file

@ -303,16 +303,11 @@ helpers.neovim-plugin.mkNeovimPlugin {
extraOptions = { extraOptions = {
folding = mkEnableOption "tree-sitter based folding"; folding = mkEnableOption "tree-sitter based folding";
gccPackage = helpers.mkPackageOption { gccPackage = lib.mkPackageOption pkgs "gcc" {
name = "gcc"; nullable = true;
default = pkgs.gcc; example = "pkgs.gcc14";
defaultText = literalExpression "pkgs.gcc"; extraDescription = ''
example = literalExpression "pkgs.gcc14";
description = ''
Which package (if any) to be added as the GCC compiler.
This is required to build grammars if you are not using `nixGrammars`. This is required to build grammars if you are not using `nixGrammars`.
To disable the installation of GCC, set this option to `null`.
''; '';
}; };
@ -358,28 +353,18 @@ helpers.neovim-plugin.mkNeovimPlugin {
description = "Whether to enable Nixvim injections, e.g. highlighting `extraConfigLua` as lua."; description = "Whether to enable Nixvim injections, e.g. highlighting `extraConfigLua` as lua.";
}; };
nodejsPackage = helpers.mkPackageOption { nodejsPackage = lib.mkPackageOption pkgs "nodejs" {
name = "nodejs"; nullable = true;
default = pkgs.nodejs; example = "pkgs.nodejs_22";
defaultText = literalExpression "pkgs.nodejs"; extraDescription = ''
example = literalExpression "pkgs.nodejs_22";
description = ''
Which package (if any) to be added as the nodejs package.
This is required to build grammars if you are not using `nixGrammars`. This is required to build grammars if you are not using `nixGrammars`.
To disable the installation of NodeJS, set this option to `null`.
''; '';
}; };
treesitterPackage = helpers.mkPackageOption { treesitterPackage = lib.mkPackageOption pkgs "tree-sitter" {
name = "tree-sitter"; nullable = true;
default = pkgs.tree-sitter; extraDescription = ''
defaultText = literalExpression "pkgs.tree-sitter";
description = ''
Which package (if any) to be added as the tree-sitter binary.
This is required to build grammars if you are not using `nixGrammars`. This is required to build grammars if you are not using `nixGrammars`.
To disable the installation of tree-sitter, set this option to `null`.
''; '';
}; };
}; };