Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions lazyvim/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ in
./extras/lang/markdown.nix
./extras/lang/nix.nix
./extras/lang/prisma.nix
./extras/lang/rust.nix
./extras/lang/svelte.nix
./extras/lang/tailwind.nix
./extras/lang/typescript.nix
Expand Down
37 changes: 37 additions & 0 deletions lazyvim/extras/lang/rust.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
self:
{
config,
lib,
pkgs,
...
}:
let
inherit (lib.modules) mkIf;
inherit (lib.options) mkEnableOption;
inherit (lib.lists) optional;

cfg = config.programs.lazyvim;
in
{
options.programs.lazyvim.extras.lang.rust = {
enable = mkEnableOption "the lang.rust extra";
};

config = mkIf cfg.extras.lang.rust.enable {
programs.neovim = {
extraPackages = [pkgs.rust-analyzer] ++ optional cfg.extras.dap.core.enable pkgs.lldb;

plugins =
[
(pkgs.vimPlugins.nvim-treesitter.withPlugins (
plugins: builtins.attrValues {inherit (plugins) rust;}
))
]
++ (with pkgs.vimPlugins; [
crates-nvim
rustaceanvim
clangd_extensions-nvim
Copy link
Owner

@matadaniel matadaniel Feb 5, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Genuinely curious as to why clangd-extensions is needed

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll give it a test without. When I made the PR I was having issues with my LazyVim being half stuck between versions and rustaceanvim wasn't working. I've figured out that issue now though.

]);
};
};
}