nix-community.nixvim/plugins/by-name/codeium-nvim/default.nix

90 lines
2.6 KiB
Nix
Raw Normal View History

2024-01-01 21:50:06 +01:00
{
lib,
...
}:
2024-05-05 19:39:35 +02:00
let
inherit (lib.nixvim) defaultNullOpts;
2024-05-05 19:39:35 +02:00
in
2024-12-22 09:58:27 +00:00
lib.nixvim.plugins.mkNeovimPlugin {
name = "codeium-nvim";
packPathName = "codeium.nvim";
moduleName = "codeium";
maintainers = with lib.maintainers; [
GaetanLepage
khaneliman
];
# TODO: added 2024-09-03 remove after 24.11
inherit (import ./deprecations.nix) deprecateExtraOptions optionsRenamedToSettings;
2024-01-01 21:50:06 +01:00
# Register nvim-cmp association
imports = [
{ cmpSourcePlugins.codeium = "codeium-nvim"; }
];
settingsOptions = {
config_path = defaultNullOpts.mkStr {
__raw = "vim.fn.stdpath('cache') .. '/codeium/config.json'";
} "The path to the config file, used to store the API key.";
2024-01-01 21:50:06 +01:00
bin_path = defaultNullOpts.mkStr {
__raw = "vim.fn.stdpath('cache') .. '/codeium/bin'";
} "The path to the directory where the Codeium server will be downloaded to.";
2024-01-01 21:50:06 +01:00
2024-05-05 19:39:35 +02:00
api = {
host = defaultNullOpts.mkStr "server.codeium.com" ''
2024-05-05 19:39:35 +02:00
The hostname of the API server to use.
'';
2024-01-01 21:50:06 +01:00
port = defaultNullOpts.mkNullableWithRaw' {
# TODO: Added 2024-09-05; remove after 24.11
type = with lib.types; lib.nixvim.transitionType ints.positive toString (strMatching "[0-9]+");
pluginDefault = "443";
description = ''
The port of the API server to use.
'';
};
2024-05-05 19:39:35 +02:00
};
2024-01-01 21:50:06 +01:00
2024-05-05 19:39:35 +02:00
tools = {
uname = defaultNullOpts.mkStr null "The path to the `uname` binary.";
2024-01-01 21:50:06 +01:00
uuidgen = defaultNullOpts.mkStr null "The path to the `uuidgen` binary.";
2024-01-01 21:50:06 +01:00
curl = defaultNullOpts.mkStr null "The path to the `curl` binary.";
2024-01-01 21:50:06 +01:00
gzip = defaultNullOpts.mkStr null "The path to the `gzip` binary.";
2024-01-01 21:50:06 +01:00
language_server = defaultNullOpts.mkStr null ''
2024-05-05 19:39:35 +02:00
The path to the language server downloaded from the official source.
2024-01-01 21:50:06 +01:00
'';
};
wrapper = defaultNullOpts.mkStr null ''
2024-05-05 19:39:35 +02:00
The path to a wrapper script/binary that is used to execute any binaries not listed under
tools.
This is primarily useful for NixOS, where a FHS wrapper can be used for the downloaded
codeium server.
2024-01-01 21:50:06 +01:00
'';
2024-05-05 19:39:35 +02:00
detect_proxy = defaultNullOpts.mkBool false "Whether to enable the proxy detection.";
enable_chat = defaultNullOpts.mkBool false "Whether to enable the chat functionality.";
enterprise_mode = defaultNullOpts.mkBool false "Whether to enable the enterprise mode.";
2024-05-05 19:39:35 +02:00
};
settingsExample = lib.literalExpression ''
{
enable_chat = true;
tools = {
curl = lib.getExe pkgs.curl;
gzip = lib.getExe pkgs.gzip;
uname = lib.getExe' pkgs.coreutils "uname";
uuidgen = lib.getExe' pkgs.util-linux "uuidgen";
};
}
'';
2024-01-01 21:50:06 +01:00
}