plugins/copilot-lua: add nodejs dependency and remove nodePackage option

This commit is contained in:
Heitor Augusto 2025-05-17 12:53:11 -03:00
parent 284ce8043b
commit 5474f9a33f
No known key found for this signature in database
GPG key ID: 53C04F8F46A1A344

View file

@ -15,7 +15,10 @@ lib.nixvim.plugins.mkNeovimPlugin {
maintainers = [ lib.maintainers.HeitorAugustoLN ]; maintainers = [ lib.maintainers.HeitorAugustoLN ];
dependencies = [ "curl" ]; dependencies = [
"curl"
"nodejs"
];
settingsOptions = settingsOptions =
let let
@ -107,21 +110,10 @@ lib.nixvim.plugins.mkNeovimPlugin {
''; '';
}; };
copilot_node_command = copilot_node_command = defaultNullOpts.mkStr "node" ''
let
inherit (config.plugins.copilot-lua) nodePackage;
in
lib.nixvim.mkNullOrOption' {
type = types.str;
default = if nodePackage == null then null else lib.getExe nodePackage;
defaultText = lib.literalMD "`lib.getExe nodePackage` if `nodePackage` is not null, otherwise `null`";
pluginDefault = "node";
example = lib.literalExpression "lib.getExe pkgs.nodejs";
description = ''
Define the node command to use for copilot-lua. Define the node command to use for copilot-lua.
Node.js version must be 18.x or newer. Node.js version must be 20.x or newer.
''; '';
};
server_opts_overrides = defaultNullOpts.mkAttrsOf' { server_opts_overrides = defaultNullOpts.mkAttrsOf' {
type = types.anything; type = types.anything;
@ -166,16 +158,14 @@ lib.nixvim.plugins.mkNeovimPlugin {
}; };
}; };
extraOptions = { # TODO: introduced 2025-05-17: remove after 25.11
nodePackage = lib.mkPackageOption pkgs "nodejs" { imports = [
default = [ "nodejs_20" ]; (lib.mkRemovedOptionModule [
example = [ "nodejs" ]; "plugins"
nullable = true; "copilot-lua"
extraDescription = '' "nodePackage"
If non-null, will provide a default for `settings.copilot_node_command`. ] "Use `dependencies.nodejs.package` instead to change the Node.js package.")
''; ];
};
};
extraConfig = { extraConfig = {
assertions = lib.nixvim.mkAssertions "plugins.copilot-lua" { assertions = lib.nixvim.mkAssertions "plugins.copilot-lua" {