mirror of
https://github.com/nix-community/nixvim.git
synced 2025-06-22 17:03:31 +02:00
* plugins/coq: Switch to mkNeovimPlugin This allows the user to define additional options unpackaged by nixvim. No new options were defined, nor any old option was deleted. Fixes #1114
78 lines
2 KiB
Nix
78 lines
2 KiB
Nix
{
|
|
lib,
|
|
helpers,
|
|
config,
|
|
pkgs,
|
|
...
|
|
}:
|
|
with lib;
|
|
helpers.neovim-plugin.mkNeovimPlugin config {
|
|
name = "coq-nvim";
|
|
originalName = "coq_nvim";
|
|
defaultPackage = pkgs.vimPlugins.coq_nvim;
|
|
|
|
maintainers = [maintainers.traxys];
|
|
|
|
extraOptions = {
|
|
installArtifacts = mkEnableOption "and install coq-artifacts";
|
|
artifactsPackage = mkOption {
|
|
type = types.package;
|
|
description = "Package to use for coq-artifacts (when enabled with installArtifacts)";
|
|
default = pkgs.vimPlugins.coq-artifacts;
|
|
};
|
|
};
|
|
|
|
# TODO: Introduced 12-03-2022, remove 12-05-2022
|
|
optionsRenamedToSettings = [
|
|
"xdg"
|
|
"autoStart"
|
|
];
|
|
imports = let
|
|
basePath = ["plugins" "coq-nvim"];
|
|
settingsPath = basePath ++ ["settings"];
|
|
in [
|
|
(
|
|
mkRenamedOptionModule
|
|
(basePath ++ ["recommendedKeymaps"])
|
|
(settingsPath ++ ["keymap" "recommended"])
|
|
)
|
|
|
|
(
|
|
mkRenamedOptionModule
|
|
(basePath ++ ["alwaysComplete"])
|
|
(settingsPath ++ ["completion" "always"])
|
|
)
|
|
];
|
|
|
|
callSetup = false;
|
|
settingsOptions = {
|
|
auto_start =
|
|
helpers.mkNullOrOption
|
|
(with helpers.nixvimTypes; maybeRaw (either bool (enum ["shut-up"])))
|
|
"Auto-start or shut up";
|
|
|
|
xdg = mkOption {
|
|
type = types.bool;
|
|
default = true;
|
|
description = "Use XDG paths. May be required when installing coq with Nix.";
|
|
};
|
|
|
|
keymap.recommended = helpers.defaultNullOpts.mkBool true "Use the recommended keymaps";
|
|
|
|
completion.always = helpers.defaultNullOpts.mkBool true "Always trigger completion on keystroke";
|
|
};
|
|
|
|
extraConfig = cfg: {
|
|
extraPlugins = mkIf cfg.installArtifacts [
|
|
cfg.artifactsPackage
|
|
];
|
|
|
|
plugins.lsp = {
|
|
preConfig = ''
|
|
vim.g.coq_settings = ${helpers.toLuaObject cfg.settings}
|
|
local coq = require 'coq'
|
|
'';
|
|
setupWrappers = [(s: ''coq.lsp_ensure_capabilities(${s})'')];
|
|
};
|
|
};
|
|
}
|