Skip to content

Commit 762f722

Browse files
committed
plugins/blink-copilot: use mkBlinkPluginModule
1 parent ac08002 commit 762f722

File tree

1 file changed

+24
-46
lines changed

1 file changed

+24
-46
lines changed

plugins/by-name/blink-copilot/default.nix

Lines changed: 24 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -1,60 +1,38 @@
11
{ lib, ... }:
2-
lib.nixvim.plugins.mkNeovimPlugin {
2+
let
33
name = "blink-copilot";
4-
package = "blink-copilot";
4+
in
5+
lib.nixvim.plugins.mkNeovimPlugin {
6+
inherit name;
57

68
maintainers = [ lib.maintainers.khaneliman ];
79

8-
description = ''
9-
This plugin should be configured through blink-cmp's `sources.providers` settings.
10-
11-
For example:
12-
13-
```nix
14-
plugins.blink-cmp = {
15-
enable = true;
16-
settings.sources.providers = {
17-
copilot = {
18-
async = true;
19-
module = "blink-copilot";
20-
name = "copilot";
21-
score_offset = 100;
22-
# Optional configurations
23-
opts = {
24-
max_completions = 3;
25-
max_attempts = 4;
26-
kind = "Copilot";
27-
debounce = 750;
28-
auto_refresh = {
29-
backward = true;
30-
forward = true;
31-
};
32-
};
33-
};
10+
imports = [
11+
(lib.nixvim.modules.mkBlinkPluginModule {
12+
pluginName = name;
13+
# TODO: compute a sane-default
14+
sourceName = "copilot";
15+
settingsExample = {
16+
async = true;
17+
score_offset = 100;
3418
};
19+
})
20+
];
21+
22+
settingsExample = {
23+
max_completions = 3;
24+
max_attempts = 4;
25+
kind = "Copilot";
26+
debounce = 750;
27+
auto_refresh = {
28+
backward = true;
29+
forward = true;
3530
};
36-
```
37-
38-
And then you can add it to blink-cmp's `sources.default` option:
39-
40-
```nix
41-
plugins.blink-cmp = {
42-
enable = true;
43-
settings.sources.default = [
44-
"lsp"
45-
"path"
46-
"luasnip"
47-
"buffer"
48-
"copilot"
49-
];
50-
};
51-
```
52-
'';
31+
};
5332

5433
# Configured through blink-cmp
5534
callSetup = false;
5635
hasLuaConfig = false;
57-
hasSettings = false;
5836

5937
extraConfig = {
6038
plugins.copilot-lua.enable = lib.mkDefault true;

0 commit comments

Comments
 (0)