mirror of
https://github.com/nix-community/nixvim.git
synced 2025-06-21 16:39:00 +02:00
helpers/vim-plugin/mkVimPlugin: refactor
This commit is contained in:
parent
66c069c48d
commit
3c174e874c
20 changed files with 739 additions and 744 deletions
|
@ -1,42 +1,43 @@
|
|||
{
|
||||
lib,
|
||||
config,
|
||||
helpers,
|
||||
pkgs,
|
||||
...
|
||||
} @ args:
|
||||
with lib; (
|
||||
with (import ../helpers.nix {inherit lib;}).vim-plugin;
|
||||
mkVimPlugin args {
|
||||
name = "copilot-vim";
|
||||
description = "copilot.vim";
|
||||
package = pkgs.vimPlugins.copilot-vim;
|
||||
globalPrefix = "copilot_";
|
||||
}:
|
||||
with lib;
|
||||
with helpers.vim-plugin;
|
||||
helpers.vim-plugin.mkVimPlugin config {
|
||||
name = "copilot-vim";
|
||||
description = "copilot.vim";
|
||||
package = pkgs.vimPlugins.copilot-vim;
|
||||
globalPrefix = "copilot_";
|
||||
|
||||
options = {
|
||||
nodeCommand = mkDefaultOpt {
|
||||
global = "node_command";
|
||||
type = types.str;
|
||||
default = "${pkgs.nodejs-18_x}/bin/node";
|
||||
description = "Tell Copilot what `node` binary to use.";
|
||||
};
|
||||
options = {
|
||||
nodeCommand = mkDefaultOpt {
|
||||
global = "node_command";
|
||||
type = types.str;
|
||||
default = "${pkgs.nodejs-18_x}/bin/node";
|
||||
description = "Tell Copilot what `node` binary to use.";
|
||||
};
|
||||
|
||||
filetypes = mkDefaultOpt {
|
||||
type = with types; attrsOf bool;
|
||||
description = ''
|
||||
A dictionary mapping file types to their enabled status
|
||||
filetypes = mkDefaultOpt {
|
||||
type = with types; attrsOf bool;
|
||||
description = ''
|
||||
A dictionary mapping file types to their enabled status
|
||||
|
||||
Default: `{}`
|
||||
'';
|
||||
example = {
|
||||
"*" = false;
|
||||
python = true;
|
||||
};
|
||||
};
|
||||
|
||||
proxy = mkDefaultOpt {
|
||||
type = types.str;
|
||||
description = "Tell Copilot what proxy server to use.";
|
||||
example = "localhost:3128";
|
||||
Default: `{}`
|
||||
'';
|
||||
example = {
|
||||
"*" = false;
|
||||
python = true;
|
||||
};
|
||||
};
|
||||
}
|
||||
)
|
||||
|
||||
proxy = mkDefaultOpt {
|
||||
type = types.str;
|
||||
description = "Tell Copilot what proxy server to use.";
|
||||
example = "localhost:3128";
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
@ -14,7 +14,7 @@ in
|
|||
useDefaultPackage ? true,
|
||||
...
|
||||
}:
|
||||
mkVimPlugin {inherit lib config pkgs;} {
|
||||
mkVimPlugin config {
|
||||
inherit name;
|
||||
extraPlugins = extraPlugins ++ (lists.optional useDefaultPackage pkgs.vimPlugins.${name});
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue