neovim-flake/modules/assistant/copilot.nix

29 lines
568 B
Nix
Raw Normal View History

2023-02-06 02:14:01 +01:00
{
pkgs,
config,
lib,
...
}:
with lib;
with builtins; let
cfg = config.vim.assistant.copilot;
in {
options.vim.assistant.copilot = {
enable = mkEnableOption "Enable GitHub Copilot";
};
config = mkIf cfg.enable {
vim.startPlugins = [
"copilot-lua"
pkgs.nodejs-slim-16_x
];
2023-02-06 02:14:01 +01:00
vim.luaConfigRC.copilot = nvim.dag.entryAnywhere ''
require("copilot").setup({
-- available options: https://github.com/zbirenbaum/copilot.lua
copilot_node_command = "${lib.getExe pkgs.nodejs-slim-16_x}",
2023-02-06 02:14:01 +01:00
})
'';
};
}