copilot: add package option (#84)

This commit is contained in:
Alexander Nortung 2022-12-15 18:04:24 +01:00 committed by GitHub
parent de6519f713
commit 470fd9c07e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -7,6 +7,11 @@ in
options = { options = {
plugins.copilot = { plugins.copilot = {
enable = mkEnableOption "Enable copilot"; enable = mkEnableOption "Enable copilot";
package = mkOption {
type = types.package;
description = "The copilot plugin package to use";
default = pkgs.vimPlugins.copilot-vim;
};
filetypes = mkOption { filetypes = mkOption {
type = types.attrsOf types.bool; type = types.attrsOf types.bool;
description = "A dictionary mapping file types to their enabled status"; description = "A dictionary mapping file types to their enabled status";
@ -27,7 +32,7 @@ in
config = config =
mkIf cfg.enable { mkIf cfg.enable {
extraPlugins = [ pkgs.vimPlugins.copilot-vim ]; extraPlugins = [ cfg.package ];
globals = { globals = {
copilot_node_command = "${pkgs.nodejs-16_x}/bin/node"; copilot_node_command = "${pkgs.nodejs-16_x}/bin/node";
copilot_filetypes = cfg.filetypes; copilot_filetypes = cfg.filetypes;