devos/users/modules/neovim/rust.nix

24 lines
632 B
Nix
Raw Normal View History

{ lib, pkgs, config, ... }:
let
cfg = config.mae.nvim.rust;
in
with lib;
{
options.mae.nvim.rust = {
enable = mkEnableOption "Enable rust support in nvim";
};
config.programs.neovim = mkIf cfg.enable {
coc.enable = true;
plugins = with pkgs.vimPlugins; [
coc-rust-analyzer
];
coc.settings = {
"rust-analyzer.server.path" = "${pkgs.rust-analyzer-nightly}/bin/rust-analyzer";
"rust-analyzer.updates.prompt" = false;
"rust-analyzer.updates.checkOnStartup" = false;
"rust-analyzer.cargo.loadOutDirsFromCheck" = true;
"rust-analyzer.procMacro.enable" = true;
};
};
}