2023-05-01 14:13:31 +00:00
|
|
|
fenix:
|
|
|
|
|
|
|
|
let
|
|
|
|
file = ./rust-toolchain.toml;
|
2023-12-31 10:05:08 +00:00
|
|
|
sha256 = "SXRtAuO4IqNOQq+nLbrsDFbVk+3aVA8NNpSZsKlVH/8=";
|
2023-05-01 14:13:31 +00:00
|
|
|
in
|
|
|
|
{
|
|
|
|
fromFile = { system }: fenix.packages.${system}.fromToolchainFile {
|
|
|
|
inherit file sha256;
|
|
|
|
};
|
|
|
|
|
|
|
|
fromTarget = { pkgs, buildPlatform, targetPlatform ? null }:
|
|
|
|
let
|
|
|
|
inherit ((pkgs.lib.importTOML file).toolchain) channel;
|
|
|
|
toolchain = fenix.packages.${buildPlatform};
|
|
|
|
in
|
|
|
|
if
|
|
|
|
isNull targetPlatform
|
|
|
|
then
|
|
|
|
fenix.packages.${buildPlatform}.${channel}.toolchain
|
|
|
|
else
|
|
|
|
toolchain.combine [
|
|
|
|
toolchain.${channel}.rustc
|
|
|
|
toolchain.${channel}.cargo
|
|
|
|
toolchain.targets.${targetPlatform}.${channel}.rust-std
|
|
|
|
];
|
|
|
|
}
|