2022-09-18 11:19:23 +01:00
|
|
|
{
|
2023-02-20 11:42:13 +01:00
|
|
|
lib,
|
2023-11-06 15:04:08 +01:00
|
|
|
helpers,
|
2023-02-20 11:42:13 +01:00
|
|
|
config,
|
2023-11-06 15:04:08 +01:00
|
|
|
pkgs,
|
2023-02-20 11:42:13 +01:00
|
|
|
...
|
|
|
|
}:
|
|
|
|
with lib; let
|
|
|
|
cfg = config.plugins.coq-nvim;
|
|
|
|
in {
|
2022-01-09 23:00:19 +00:00
|
|
|
options = {
|
2022-09-18 11:19:23 +01:00
|
|
|
plugins.coq-nvim = {
|
2023-01-22 03:32:08 +00:00
|
|
|
enable = mkEnableOption "coq-nvim";
|
2022-01-09 23:00:19 +00:00
|
|
|
|
2023-01-25 19:46:49 +01:00
|
|
|
package = helpers.mkPackageOption "coq-nvim" pkgs.vimPlugins.coq_nvim;
|
2023-01-19 10:45:15 +00:00
|
|
|
|
2023-10-09 07:58:51 -05:00
|
|
|
installArtifacts = mkEnableOption "and install coq-artifacts";
|
2022-01-09 23:00:19 +00:00
|
|
|
|
|
|
|
autoStart = mkOption {
|
2023-02-20 11:42:13 +01:00
|
|
|
type = with types; nullOr (oneOf [bool (enum ["shut-up"])]);
|
2022-01-09 23:00:19 +00:00
|
|
|
default = null;
|
|
|
|
description = "Auto-start or shut up";
|
|
|
|
};
|
|
|
|
|
|
|
|
recommendedKeymaps = mkOption {
|
|
|
|
type = with types; nullOr bool;
|
|
|
|
default = null;
|
|
|
|
description = "Use the recommended keymaps";
|
|
|
|
};
|
2023-11-30 16:34:58 +01:00
|
|
|
|
|
|
|
alwaysComplete = mkOption {
|
|
|
|
type = with types; nullOr bool;
|
|
|
|
default = null;
|
|
|
|
description = "Always trigger completion on keystroke";
|
|
|
|
};
|
2022-01-09 23:00:19 +00:00
|
|
|
};
|
|
|
|
};
|
2023-02-20 11:42:13 +01:00
|
|
|
config = let
|
|
|
|
settings = {
|
|
|
|
auto_start = cfg.autoStart;
|
|
|
|
"keymap.recommended" = cfg.recommendedKeymaps;
|
2023-02-20 10:50:48 +00:00
|
|
|
xdg = true;
|
2023-11-30 16:34:58 +01:00
|
|
|
"completion.always" = cfg.alwaysComplete;
|
2023-02-20 11:42:13 +01:00
|
|
|
};
|
|
|
|
in
|
2022-09-18 11:19:23 +01:00
|
|
|
mkIf cfg.enable {
|
2023-02-20 11:42:13 +01:00
|
|
|
extraPlugins =
|
|
|
|
[
|
|
|
|
cfg.package
|
|
|
|
]
|
2023-03-26 15:44:45 +02:00
|
|
|
++ optional cfg.installArtifacts pkgs.vimPlugins.coq-artifacts;
|
2022-01-09 23:00:19 +00:00
|
|
|
plugins.lsp = {
|
|
|
|
preConfig = ''
|
|
|
|
vim.g.coq_settings = ${helpers.toLuaObject settings}
|
|
|
|
local coq = require 'coq'
|
|
|
|
'';
|
2023-02-20 11:42:13 +01:00
|
|
|
setupWrappers = [(s: ''coq.lsp_ensure_capabilities(${s})'')];
|
2022-01-09 23:00:19 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|