mirror of
https://github.com/NotAShelf/nvf.git
synced 2026-01-09 20:27:16 +00:00
modules: explicit lib usage
This commit is contained in:
parent
9b2e2ef833
commit
caf342adb1
27 changed files with 673 additions and 684 deletions
|
|
@ -4,7 +4,9 @@
|
|||
lib,
|
||||
...
|
||||
}: let
|
||||
inherit (lib) mkEnableOption mkOption types;
|
||||
inherit (lib.types) enum float nullOr package str;
|
||||
inherit (lib.options) mkOption mkEnableOption;
|
||||
inherit (lib.meta) getExe;
|
||||
|
||||
cfg = config.vim.assistant.copilot;
|
||||
in {
|
||||
|
|
@ -14,7 +16,7 @@ in {
|
|||
|
||||
panel = {
|
||||
position = mkOption {
|
||||
type = types.enum [
|
||||
type = enum [
|
||||
"bottom"
|
||||
"top"
|
||||
"left"
|
||||
|
|
@ -24,7 +26,7 @@ in {
|
|||
description = "Panel position";
|
||||
};
|
||||
ratio = mkOption {
|
||||
type = types.float;
|
||||
type = float;
|
||||
default = 0.4;
|
||||
description = "Panel size";
|
||||
};
|
||||
|
|
@ -33,81 +35,81 @@ in {
|
|||
mappings = {
|
||||
panel = {
|
||||
jumpPrev = mkOption {
|
||||
type = types.nullOr types.str;
|
||||
type = nullOr str;
|
||||
default = "[[";
|
||||
description = "Jump to previous suggestion";
|
||||
};
|
||||
jumpNext = mkOption {
|
||||
type = types.nullOr types.str;
|
||||
type = nullOr str;
|
||||
default = "]]";
|
||||
description = "Jump to next suggestion";
|
||||
};
|
||||
accept = mkOption {
|
||||
type = types.nullOr types.str;
|
||||
type = nullOr str;
|
||||
default = "<CR>";
|
||||
description = "Accept suggestion";
|
||||
};
|
||||
refresh = mkOption {
|
||||
type = types.nullOr types.str;
|
||||
type = nullOr str;
|
||||
default = "gr";
|
||||
description = "Refresh suggestions";
|
||||
};
|
||||
open = mkOption {
|
||||
type = types.nullOr types.str;
|
||||
type = nullOr str;
|
||||
default = "<M-CR>";
|
||||
description = "Open suggestions";
|
||||
};
|
||||
};
|
||||
suggestion = {
|
||||
accept = mkOption {
|
||||
type = types.nullOr types.str;
|
||||
type = nullOr str;
|
||||
default = "<M-l>";
|
||||
description = "Accept suggetion";
|
||||
};
|
||||
acceptWord = mkOption {
|
||||
type = types.nullOr types.str;
|
||||
type = nullOr str;
|
||||
default = null;
|
||||
description = "Accept next word";
|
||||
};
|
||||
acceptLine = mkOption {
|
||||
type = types.nullOr types.str;
|
||||
type = nullOr str;
|
||||
default = null;
|
||||
description = "Accept next line";
|
||||
};
|
||||
prev = mkOption {
|
||||
type = types.nullOr types.str;
|
||||
type = nullOr str;
|
||||
default = "<M-[>";
|
||||
description = "Previous suggestion";
|
||||
};
|
||||
next = mkOption {
|
||||
type = types.nullOr types.str;
|
||||
type = nullOr str;
|
||||
default = "<M-]>";
|
||||
description = "Next suggestion";
|
||||
};
|
||||
dismiss = mkOption {
|
||||
type = types.nullOr types.str;
|
||||
type = nullOr str;
|
||||
default = "<C-]>";
|
||||
description = "Dismiss suggestion";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
copilotNodeCommand = mkOption {
|
||||
type = types.str;
|
||||
default = "${lib.getExe cfg.copilotNodePackage}";
|
||||
description = ''
|
||||
The command that will be executed to initiate nodejs for GitHub Copilot.
|
||||
Recommended to leave as default.
|
||||
'';
|
||||
};
|
||||
|
||||
copilotNodePackage = mkOption {
|
||||
type = with types; nullOr package;
|
||||
type = nullOr package;
|
||||
default = pkgs.nodejs-slim;
|
||||
description = ''
|
||||
The nodeJS package that will be used for GitHub Copilot. If you are using a custom node command
|
||||
you may want to set this option to null so that the package is not pulled from nixpkgs.
|
||||
'';
|
||||
};
|
||||
|
||||
copilotNodeCommand = mkOption {
|
||||
type = str;
|
||||
default = "${getExe cfg.copilotNodePackage}";
|
||||
description = ''
|
||||
The command that will be executed to initiate nodejs for GitHub Copilot.
|
||||
Recommended to leave as default.
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue