2023-02-27 14:05:43 +00:00
|
|
|
{
|
|
|
|
pkgs,
|
|
|
|
config,
|
|
|
|
lib,
|
|
|
|
...
|
2023-11-07 00:50:27 +00:00
|
|
|
}: let
|
|
|
|
inherit (lib) mkEnableOption mkOption types;
|
|
|
|
|
2023-05-10 09:11:33 +00:00
|
|
|
cfg = config.vim.assistant.copilot;
|
|
|
|
in {
|
2023-02-27 14:05:43 +00:00
|
|
|
options.vim.assistant.copilot = {
|
2023-06-05 20:10:25 +00:00
|
|
|
enable = mkEnableOption "GitHub Copilot AI assistant";
|
2023-07-24 13:51:24 +00:00
|
|
|
cmp.enable = mkEnableOption "nvim-cmp integration for GitHub Copilot";
|
2023-02-27 14:05:43 +00:00
|
|
|
|
2023-04-11 12:38:27 +00:00
|
|
|
panel = {
|
|
|
|
position = mkOption {
|
|
|
|
type = types.enum [
|
|
|
|
"bottom"
|
|
|
|
"top"
|
|
|
|
"left"
|
|
|
|
"right"
|
|
|
|
];
|
|
|
|
default = "bottom";
|
|
|
|
description = "Panel position";
|
|
|
|
};
|
|
|
|
ratio = mkOption {
|
|
|
|
type = types.float;
|
|
|
|
default = 0.4;
|
|
|
|
description = "Panel size";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2023-04-04 22:53:21 +00:00
|
|
|
mappings = {
|
|
|
|
panel = {
|
|
|
|
jumpPrev = mkOption {
|
|
|
|
type = types.nullOr types.str;
|
|
|
|
default = "[[";
|
|
|
|
description = "Jump to previous suggestion";
|
|
|
|
};
|
|
|
|
jumpNext = mkOption {
|
|
|
|
type = types.nullOr types.str;
|
|
|
|
default = "]]";
|
|
|
|
description = "Jump to next suggestion";
|
|
|
|
};
|
|
|
|
accept = mkOption {
|
|
|
|
type = types.nullOr types.str;
|
|
|
|
default = "<CR>";
|
|
|
|
description = "Accept suggestion";
|
|
|
|
};
|
|
|
|
refresh = mkOption {
|
|
|
|
type = types.nullOr types.str;
|
|
|
|
default = "gr";
|
|
|
|
description = "Refresh suggestions";
|
|
|
|
};
|
|
|
|
open = mkOption {
|
|
|
|
type = types.nullOr types.str;
|
|
|
|
default = "<M-CR>";
|
|
|
|
description = "Open suggestions";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
suggestion = {
|
|
|
|
accept = mkOption {
|
|
|
|
type = types.nullOr types.str;
|
|
|
|
default = "<M-l>";
|
|
|
|
description = "Accept suggetion";
|
|
|
|
};
|
|
|
|
acceptWord = mkOption {
|
|
|
|
type = types.nullOr types.str;
|
|
|
|
default = null;
|
|
|
|
description = "Accept next word";
|
|
|
|
};
|
|
|
|
acceptLine = mkOption {
|
|
|
|
type = types.nullOr types.str;
|
|
|
|
default = null;
|
|
|
|
description = "Accept next line";
|
|
|
|
};
|
|
|
|
prev = mkOption {
|
|
|
|
type = types.nullOr types.str;
|
|
|
|
default = "<M-[>";
|
|
|
|
description = "Previous suggestion";
|
|
|
|
};
|
|
|
|
next = mkOption {
|
|
|
|
type = types.nullOr types.str;
|
|
|
|
default = "<M-]>";
|
|
|
|
description = "Next suggestion";
|
|
|
|
};
|
|
|
|
dismiss = mkOption {
|
|
|
|
type = types.nullOr types.str;
|
|
|
|
default = "<C-]>";
|
|
|
|
description = "Dismiss suggestion";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2023-07-24 13:51:24 +00:00
|
|
|
copilotNodeCommand = mkOption {
|
2023-02-27 14:05:43 +00:00
|
|
|
type = types.str;
|
2023-05-10 09:11:33 +00:00
|
|
|
default = "${lib.getExe cfg.copilotNodePackage}";
|
2023-07-24 13:51:24 +00:00
|
|
|
description = ''
|
|
|
|
The command that will be executed to initiate nodejs for GitHub Copilot.
|
|
|
|
Recommended to leave as default.
|
|
|
|
'';
|
2023-02-27 14:05:43 +00:00
|
|
|
};
|
2023-05-10 09:11:33 +00:00
|
|
|
|
|
|
|
copilotNodePackage = mkOption {
|
2023-07-24 13:51:24 +00:00
|
|
|
type = with types; nullOr package;
|
|
|
|
default = pkgs.nodejs-slim;
|
|
|
|
description = ''
|
|
|
|
The nodeJS package that will be used for GitHub Copilot. If you are using a custom node command
|
|
|
|
you may want to set this option to null so that the package is not pulled from nixpkgs.
|
|
|
|
'';
|
2023-05-10 09:11:33 +00:00
|
|
|
};
|
2023-02-27 14:05:43 +00:00
|
|
|
};
|
|
|
|
}
|