You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would like to create project-level flakes which declares the relevant rust packages/tools to install, rather than this being declared system-wide.
I am having trouble getting this to work correctly with my system setup. My current working solution is also less than ideal.
I am using nixvim to install neovim and use the rust-analyzer lsp. This depends on rustc, cargo, rust-analyzer and the rust-src path. If I declare fenix rust packages in my project-level flake devshell, the rust packages used by nixvim can get out of sync, as nixvim will use standard rust packages from nixpkgs. This can cause all kinds of problems. For example, a slight difference in cargo versions would cause the build cache to be invalidated which completely broke incremental builds.
My current solution for keeping packages in sync is to create a attribute set like this:
This keeps my rust packages in sync, but it makes my devshells less reproducible; if I specify fenix overlays in a devshell, there is a hidden dependency on my nixvim configuration. If I want to change the version of the toolchain I would need to change my devshells and my nixvim configuration. Because of this, I just declare my rust tool chain system wide and remove any reference to rust in my devshells.
Is there a way to make all relevant rust packages in my system derive from the fenix overlay? I am currently trying to do this:
But it isn't working. I am getting an error that cargo doesn't have the expected overlay attribute. I'm assuming I'm using the overlay incorrectly here.
Any help would be appreciated. Thank you.
The text was updated successfully, but these errors were encountered:
I would like to create project-level flakes which declares the relevant rust packages/tools to install, rather than this being declared system-wide.
I am having trouble getting this to work correctly with my system setup. My current working solution is also less than ideal.
I am using nixvim to install neovim and use the rust-analyzer lsp. This depends on rustc, cargo, rust-analyzer and the rust-src path. If I declare fenix rust packages in my project-level flake devshell, the rust packages used by nixvim can get out of sync, as nixvim will use standard rust packages from nixpkgs. This can cause all kinds of problems. For example, a slight difference in cargo versions would cause the build cache to be invalidated which completely broke incremental builds.
My current solution for keeping packages in sync is to create a attribute set like this:
Use this set to install rust packages system-wide
Then use the set when declaring my nixvim configuration
This keeps my rust packages in sync, but it makes my devshells less reproducible; if I specify fenix overlays in a devshell, there is a hidden dependency on my nixvim configuration. If I want to change the version of the toolchain I would need to change my devshells and my nixvim configuration. Because of this, I just declare my rust tool chain system wide and remove any reference to rust in my devshells.
Is there a way to make all relevant rust packages in my system derive from the fenix overlay? I am currently trying to do this:
But it isn't working. I am getting an error that cargo doesn't have the expected
overlay
attribute. I'm assuming I'm using the overlay incorrectly here.Any help would be appreciated. Thank you.
The text was updated successfully, but these errors were encountered: