2024-07-03 17:54:39 +02:00
|
|
|
|
{
|
|
|
|
|
lib,
|
|
|
|
|
helpers,
|
|
|
|
|
...
|
|
|
|
|
}:
|
|
|
|
|
with lib;
|
2024-12-22 09:58:27 +00:00
|
|
|
|
lib.nixvim.plugins.mkNeovimPlugin {
|
2024-07-03 17:54:39 +02:00
|
|
|
|
name = "chatgpt";
|
2024-12-13 08:27:14 -06:00
|
|
|
|
packPathName = "ChatGPT.nvim";
|
2024-09-02 14:05:11 +01:00
|
|
|
|
package = "ChatGPT-nvim";
|
2024-07-03 17:54:39 +02:00
|
|
|
|
|
|
|
|
|
maintainers = [ maintainers.GaetanLepage ];
|
|
|
|
|
|
2025-04-27 09:53:12 +02:00
|
|
|
|
dependencies = [ "curl" ];
|
|
|
|
|
|
2025-04-06 17:17:51 +02:00
|
|
|
|
# TODO: added 2025-04-06, remove after 25.05
|
|
|
|
|
imports = [
|
|
|
|
|
(lib.nixvim.mkRemovedPackageOptionModule {
|
|
|
|
|
plugin = "chatgpt";
|
|
|
|
|
packageName = "curl";
|
|
|
|
|
})
|
|
|
|
|
];
|
2024-07-03 17:54:39 +02:00
|
|
|
|
|
|
|
|
|
settingsOptions = {
|
|
|
|
|
api_key_cmd = helpers.defaultNullOpts.mkStr null ''
|
|
|
|
|
The path and arguments to an executable that returns the API key via stdout.
|
|
|
|
|
'';
|
|
|
|
|
|
|
|
|
|
yank_register = helpers.defaultNullOpts.mkStr "+" ''
|
|
|
|
|
Which register to use for copying.
|
|
|
|
|
'';
|
|
|
|
|
|
|
|
|
|
extra_curl_params = helpers.defaultNullOpts.mkListOf' {
|
|
|
|
|
type = types.str;
|
|
|
|
|
pluginDefault = null;
|
|
|
|
|
description = ''
|
|
|
|
|
Custom cURL parameters can be passed using this option.
|
|
|
|
|
It can be useful if you need to include additional headers for requests.
|
|
|
|
|
'';
|
|
|
|
|
example = [
|
|
|
|
|
"-H"
|
|
|
|
|
"Origin: https://example.com"
|
|
|
|
|
];
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
show_line_numbers = helpers.defaultNullOpts.mkBool true ''
|
|
|
|
|
Whether to show line numbers in the ChatGPT window.
|
|
|
|
|
'';
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
settingsExample = {
|
|
|
|
|
welcome_message = "Hello world";
|
|
|
|
|
loading_text = "loading";
|
|
|
|
|
question_sign = "";
|
|
|
|
|
answer_sign = "ﮧ";
|
|
|
|
|
max_line_length = 120;
|
|
|
|
|
yank_register = "+";
|
|
|
|
|
chat_layout = {
|
|
|
|
|
relative = "editor";
|
|
|
|
|
position = "50%";
|
|
|
|
|
};
|
|
|
|
|
openai_params = {
|
|
|
|
|
model = "gpt-3.5-turbo";
|
|
|
|
|
frequency_penalty = 0;
|
|
|
|
|
presence_penalty = 0;
|
|
|
|
|
max_tokens = 300;
|
|
|
|
|
};
|
|
|
|
|
openai_edit_params = {
|
|
|
|
|
model = "code-davinci-edit-001";
|
|
|
|
|
temperature = 0;
|
|
|
|
|
};
|
|
|
|
|
keymaps = {
|
|
|
|
|
close = [ "<C-c>" ];
|
|
|
|
|
submit = "<C-s>";
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
}
|