nix-community.nixvim/plugins/by-name/chatgpt/default.nix
osbm a41559f093
Some checks are pending
Publish every Git push to main to FlakeHub / flakehub-publish (push) Waiting to run
Publish every git push to Flakestry / publish-flake (push) Waiting to run
Documentation / Version info (push) Waiting to run
Documentation / Build (push) Blocked by required conditions
Documentation / Combine builds (push) Blocked by required conditions
Documentation / Deploy (push) Blocked by required conditions
treewide: add plugin descriptions
2025-06-24 06:10:11 +00:00

78 lines
1.8 KiB
Nix
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

{
lib,
helpers,
...
}:
with lib;
lib.nixvim.plugins.mkNeovimPlugin {
name = "chatgpt";
packPathName = "ChatGPT.nvim";
package = "ChatGPT-nvim";
description = "Effortless Natural Language Generation with OpenAI's ChatGPT API";
maintainers = [ maintainers.GaetanLepage ];
dependencies = [ "curl" ];
# TODO: added 2025-04-06, remove after 25.05
imports = [
(lib.nixvim.mkRemovedPackageOptionModule {
plugin = "chatgpt";
packageName = "curl";
})
];
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>";
};
};
}