mirror of
https://github.com/soywod/himalaya.git
synced 2024-11-25 12:30:22 +00:00
27 lines
683 B
Nix
27 lines
683 B
Nix
fenix:
|
|
|
|
let
|
|
file = ./rust-toolchain.toml;
|
|
sha256 = "Q9UgzzvxLi4x9aWUJTn+/5EXekC98ODRU1TwhUs9RnY=";
|
|
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
|
|
];
|
|
}
|