Closed szg251 closed 11 months ago
Instead of using the nixpkgs
version of these tools you should use the perSystem.nci.toolchainConfig
option to add these tools. Like here:
{
nci.toolchainConfig = {
channel = "stable";
components = ["rust-analyzer" "rust-src" "clippy" "rustfmt"];
};
}
(note that if you use a rust-toolchain.toml file nci will automatically use that)
Oh, nice that sloved my problem!
I have a followup question: my main environment was fixed, but I'm also using pre-commit hooks. I can supply custom tools to these, is there way to get these from nci?
I was trying to get it with config.nci.toolchains.shell
, but I had no luck yet..
config.nci.toolchains.shell
is a derivation with all the components, so you should be able to do something like "${config.nci.toolchains.shell}/bin/cargo
(or other binaries).
I installed clippy in my project, but I'm having an issue that I could not solve. This is how I added clippy:
And this is the error I get:
I'm still investigating the issue, but it seems like I'm using the wrong
rustc
version for clipppy. I tried the cleaning the target directory and applying rust-overlay following "nci/rust-overlay", but no success. Do you have any ideas?Also, I think it would be a great idea, to expose some configuration to add these tools easily.