Add rust-src toolchain component

Provides sources of standard library, e.g. for rust-analyzer.
This commit is contained in:
Yuval Kogman 2023-05-25 22:31:35 +03:00
parent f381b8a291
commit fbef9e0916

View file

@ -22,13 +22,17 @@
rustToolchain = rustToolchain =
let let
rust = super.rust-bin; rust = super.rust-bin;
in toolchain =
if builtins.pathExists ./rust-toolchain.toml then if builtins.pathExists ./rust-toolchain.toml then
rust.fromRustupToolchainFile ./rust-toolchain.toml rust.fromRustupToolchainFile ./rust-toolchain.toml
else if builtins.pathExists ./rust-toolchain then else if builtins.pathExists ./rust-toolchain then
rust.fromRustupToolchainFile ./rust-toolchain rust.fromRustupToolchainFile ./rust-toolchain
else else
rust.stable.latest.default; rust.stable.latest.default;
in
toolchain.override {
extensions = [ "rust-src" ]; # https://github.com/the-nix-way/dev-templates/issues/4
};
}) })
]; ];