1
0
Fork 0
mirror of https://github.com/nix-community/nixvim.git synced 2025-11-08 11:36:07 +01:00
nixvim/plugins/by-name/coq-nvim/default.nix
saygo-png 29ec33e1a8 plugins: remove deprecations "after 24.11" or less
Signed-off-by: saygo-png <saygo.mail@proton.me>
2025-10-18 18:31:00 +00:00

65 lines
1.6 KiB
Nix

{
lib,
pkgs,
...
}:
let
inherit (lib) types;
inherit (lib.nixvim) defaultNullOpts;
in
lib.nixvim.plugins.mkNeovimPlugin {
name = "coq-nvim";
package = "coq_nvim";
description = "A fast nvim completion engine.";
maintainers = with lib.maintainers; [
traxys
Kareem-Medhat
];
extraOptions = {
# TODO: should this enable option be replaced with `nullable = true` in the package option?
installArtifacts = lib.mkEnableOption "and install coq-artifacts";
artifactsPackage = lib.mkPackageOption pkgs "coq-artifacts" {
extraDescription = "Installed when `installArtifacts` is enabled.";
default = [
"vimPlugins"
"coq-artifacts"
];
};
};
callSetup = false;
settingsOptions = {
auto_start = lib.nixvim.mkNullOrOption (
with types; maybeRaw (either bool (enum [ "shut-up" ]))
) "Auto-start or shut up";
xdg = lib.mkOption {
type = types.bool;
default = true;
description = "Use XDG paths. May be required when installing coq with Nix.";
};
keymap.recommended = defaultNullOpts.mkBool true "Use the recommended keymaps";
completion.always = defaultNullOpts.mkBool true "Always trigger completion on keystroke";
};
extraConfig = cfg: {
extraPlugins = lib.mkIf cfg.installArtifacts [ cfg.artifactsPackage ];
globals = {
coq_settings = cfg.settings;
};
plugins.coq-nvim.luaConfig.content = "require('coq')";
plugins.lsp = {
preConfig = ''
local coq = require 'coq'
'';
setupWrappers = [ (s: ''coq.lsp_ensure_capabilities(${s})'') ];
};
};
}