2023-06-22 09:48:17 +02:00
|
|
|
{
|
2023-11-06 15:04:08 +01:00
|
|
|
lib,
|
2024-02-09 14:21:22 +01:00
|
|
|
config,
|
|
|
|
helpers,
|
2023-06-22 09:48:17 +02:00
|
|
|
pkgs,
|
|
|
|
...
|
2024-02-09 14:21:22 +01:00
|
|
|
}:
|
|
|
|
with lib;
|
|
|
|
with helpers.vim-plugin;
|
|
|
|
helpers.vim-plugin.mkVimPlugin config {
|
|
|
|
name = "copilot-vim";
|
2024-02-13 23:25:13 +01:00
|
|
|
originalName = "copilot.vim";
|
2024-02-15 09:51:43 +01:00
|
|
|
defaultPackage = pkgs.vimPlugins.copilot-vim;
|
2024-02-09 14:21:22 +01:00
|
|
|
globalPrefix = "copilot_";
|
2023-06-22 09:48:17 +02:00
|
|
|
|
2024-03-04 09:35:28 +01:00
|
|
|
maintainers = [maintainers.GaetanLepage];
|
|
|
|
|
2024-03-02 23:35:41 +01:00
|
|
|
# TODO introduced 2024-03-02: remove 2024-05-02
|
|
|
|
deprecateExtraConfig = true;
|
|
|
|
optionsRenamedToSettings = [
|
|
|
|
"nodeCommand"
|
|
|
|
"filetypes"
|
|
|
|
"proxy"
|
|
|
|
];
|
|
|
|
|
|
|
|
settingsOptions = {
|
|
|
|
node_command = mkOption {
|
|
|
|
type = with types; nullOr str;
|
2024-02-09 14:21:22 +01:00
|
|
|
default = "${pkgs.nodejs-18_x}/bin/node";
|
|
|
|
description = "Tell Copilot what `node` binary to use.";
|
|
|
|
};
|
2023-06-22 09:48:17 +02:00
|
|
|
|
2024-03-02 23:35:41 +01:00
|
|
|
filetypes = mkOption {
|
|
|
|
type = with types; nullOr (attrsOf bool);
|
|
|
|
default = null;
|
|
|
|
description = "A dictionary mapping file types to their enabled status.";
|
2024-02-09 14:21:22 +01:00
|
|
|
example = {
|
|
|
|
"*" = false;
|
|
|
|
python = true;
|
2024-02-08 16:18:40 +01:00
|
|
|
};
|
2024-02-09 14:21:22 +01:00
|
|
|
};
|
2023-06-22 09:48:17 +02:00
|
|
|
|
2024-03-02 23:35:41 +01:00
|
|
|
proxy = mkOption {
|
|
|
|
type = with types; nullOr str;
|
|
|
|
default = null;
|
|
|
|
description = ''
|
|
|
|
Tell Copilot what proxy server to use.
|
|
|
|
|
|
|
|
If this is not set, Copilot will use the value of environment variables like
|
|
|
|
`$HTTPS_PROXY`.
|
|
|
|
'';
|
2024-02-09 14:21:22 +01:00
|
|
|
example = "localhost:3128";
|
2024-02-08 16:18:40 +01:00
|
|
|
};
|
2024-03-02 23:35:41 +01:00
|
|
|
|
|
|
|
proxy_strict_ssl = helpers.mkNullOrOption types.bool ''
|
|
|
|
Corporate proxies sometimes use a man-in-the-middle SSL certificate which is incompatible
|
|
|
|
with GitHub Copilot.
|
|
|
|
To work around this, SSL certificate verification can be disabled by setting this option to
|
|
|
|
`false`.
|
|
|
|
|
|
|
|
You can also tell `Node.js` to disable SSL verification by setting the
|
|
|
|
`$NODE_TLS_REJECT_UNAUTHORIZED` environment variable to `"0"`.
|
|
|
|
'';
|
|
|
|
|
|
|
|
workspace_folders = helpers.mkNullOrOption (with types; listOf str) ''
|
|
|
|
A list of "workspace folders" or project roots that Copilot may use to improve to improve
|
|
|
|
the quality of suggestions.
|
|
|
|
|
|
|
|
Example: ["~/Projects/myproject"]
|
|
|
|
|
|
|
|
You can also set `b:workspace_folder` for an individual buffer and newly seen values will be
|
|
|
|
added automatically.
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
|
|
|
settingsExample = {
|
|
|
|
filetypes = {
|
|
|
|
"*" = false;
|
|
|
|
python = true;
|
|
|
|
};
|
|
|
|
proxy = "localhost:3128";
|
|
|
|
proxy_strict_ssl = false;
|
|
|
|
workspace_folders = ["~/Projects/myproject"];
|
2024-02-09 14:21:22 +01:00
|
|
|
};
|
|
|
|
}
|