nix-dylint/lib/mk-cargo-dylint-driver.nix
Marcel Müller c394a61aa0 Directly use the toolchain as given
Previously we hardcoded the nightly chain. This might not be true in the
future!

Signed-off-by: Marcel Müller <neikos@neikos.email>
2025-03-04 11:08:21 +01:00

33 lines
584 B
Nix

{
pkgs,
craneLib,
}:
toolchainName:
let
pname = "cargo-dylint-driver-${toolchainName}";
version = "4.0.0";
src = ../dylint_driver;
toolchain =
(pkgs.rust-bin.fromRustupToolchainFile (
pkgs.writeText "${toolchainName}-toolchain.toml" toolchainName
)).override
{
extensions = [
"rustc-dev"
];
};
in
(craneLib.overrideToolchain toolchain).buildPackage ({
inherit pname version src;
strictDeps = true;
cargoArtifacts = null;
RUSTUP_TOOLCHAIN = toolchainName;
doNotRemoveReferencesToRustToolchain = true;
})