1
0
Fork 0
mirror of https://github.com/nix-community/nixvim.git synced 2025-12-08 18:11:07 +01:00
nixvim/plugins/by-name/rustaceanvim/default.nix
2025-12-07 23:34:03 +00:00

53 lines
1.3 KiB
Nix

{
lib,
config,
...
}:
lib.nixvim.plugins.mkNeovimPlugin {
name = "rustaceanvim";
description = "A Neovim plugin for Rust development, providing features like LSP support, code navigation, and more.";
maintainers = [ lib.maintainers.GaetanLepage ];
dependencies = [ "rust-analyzer" ];
settingsOptions = import ./settings-options.nix { inherit lib; };
settingsExample = {
server = {
standalone = false;
cmd = [
"rustup"
"run"
"nightly"
"rust-analyzer"
];
default_settings = {
rust-analyzer = {
inlayHints = {
lifetimeElisionHints = {
enable = "always";
};
};
check = {
command = "clippy";
};
};
};
};
};
callSetup = false;
hasLuaConfig = false;
extraConfig = cfg: {
globals.rustaceanvim = cfg.settings;
assertions = lib.nixvim.mkAssertions "plugins.rustaceanvim" {
assertion = cfg.enable -> !config.plugins.lsp.servers.rust_analyzer.enable;
message = ''
Both `plugins.rustaceanvim.enable` and `plugins.lsp.servers.rust_analyzer.enable` are true.
Disable one of them otherwise you will have multiple clients attached to each buffer.
'';
};
};
}