feat: separate copilot module and configuration

This commit is contained in:
NotAShelf 2023-02-27 17:05:43 +03:00
commit 3694a84646
No known key found for this signature in database
GPG key ID: 5B5C8895F28445F1
3 changed files with 50 additions and 0 deletions

View file

@ -0,0 +1,24 @@
{
pkgs,
config,
lib,
...
}:
with lib;
with builtins; let
cfg = config.vim.assistant.copilot;
in {
config = mkIf cfg.enable {
vim.startPlugins = [
"copilot-lua"
pkgs.nodejs-slim-16_x
];
vim.luaConfigRC.copilot = nvim.dag.entryAnywhere ''
require("copilot").setup({
-- available options: https://github.com/zbirenbaum/copilot.lua
copilot_node_command = "${cfg.copilot_node_command}",
})
'';
};
}