mirror of
https://github.com/nix-community/nixvim.git
synced 2025-06-21 00:25:42 +02:00
plugins/copilot-lua: add nodejs dependency and remove nodePackage
option
This commit is contained in:
parent
284ce8043b
commit
5474f9a33f
1 changed files with 16 additions and 26 deletions
|
@ -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" {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue