-
Notifications
You must be signed in to change notification settings - Fork 8
Add lang.rust #3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
Thank you for your contribution and your kind words! I don't use Rust currently, but this will help those who do. |
| ++ (with pkgs.vimPlugins; [ | ||
| crates-nvim | ||
| rustaceanvim | ||
| clangd_extensions-nvim |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
|
Let's wait and see what happens with LazyVim/LazyVim#5537. I would appreciate it if you could go and check if rustaceanvim does detect codelldb. |
lazyvim/extras/lang/rust.nix
Outdated
|
|
||
| config = mkIf cfg.extras.lang.rust.enable { | ||
| programs.neovim = { | ||
| extraPackages = [ pkgs.rust-analyzer ]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this PR! I tested it out and would just note that it might be useful to be able to disable installation of rust-analyzer nix-community/nixvim#1135. Not that it's ideal, but, for example, if someone were using rustup, this could conflict.
| (pkgs.vimPlugins.nvim-treesitter.withPlugins ( | ||
| plugins: builtins.attrValues { inherit (plugins) rust; } | ||
| )) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This needs to define __darwinAllowLocalNetworking in order to work on Darwin.
| (pkgs.vimPlugins.nvim-treesitter.withPlugins ( | |
| plugins: builtins.attrValues { inherit (plugins) rust; } | |
| )) | |
| # NOTE: enabling rust treesitter on Darwin leads to | |
| # error: The option `programs.neovim.plugins."[definition 2-entry 1]" | |
| # .__darwinAllowLocalNetworking' does not exist. | |
| (if pkgs.stdenv.isDarwin then | |
| pkgs.vimUtils.buildVimPlugin { | |
| inherit (nvim-treesitter.withPlugins ( | |
| plugins: with plugins; [ rust ron ] | |
| )) pname version src meta; | |
| __darwinAllowLocalNetworking = true; | |
| } | |
| else | |
| nvim-treesitter.withPlugins ( | |
| plugins: with plugins; [ rust ron ] | |
| ) | |
| ) |
It may also work if the attribute is just defined with an empty string value.
Note I also added ron since it's in https://github.com/LazyVim/LazyVim/blob/v14.14.0/lua/lazyvim/plugins/extras/lang/rust.lua#L39-L42 .
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you want to adopt something like this, maybe postpone my alternate list construction from #6 (comment) since it's inconsistent with the rest of the repo.
|
any update on this |
|
I'm still waiting to see what happens with the PR that @matadaniel mentioned before finishing this PR -- unless they say otherwise. |
I don't know if you're looking for contributions. I needed to have a working Rust setup so I made one in my repo - thought I'd submit the PR in case you do!
Really nice module by the way - simplifies my setup a lot!