Pass in rust-overlay for creating rust-bin.
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
{
|
||||
hello,
|
||||
lib,
|
||||
makeRustPlatform,
|
||||
rust-bin,
|
||||
pkgs,
|
||||
rust-overlay,
|
||||
|
||||
targetBins ? [ ],
|
||||
features ? [ ],
|
||||
@@ -12,34 +12,41 @@
|
||||
}:
|
||||
let
|
||||
cargoToml = (lib.importTOML ../Cargo.toml);
|
||||
rustToolchain = (rust-bin.fromRustupToolchainFile ../rust-toolchain.toml).override (
|
||||
if cargoBuildTarget != null then
|
||||
{
|
||||
targets = [ cargoBuildTarget ];
|
||||
}
|
||||
else
|
||||
{ }
|
||||
);
|
||||
baseRustPlatform = (
|
||||
makeRustPlatform {
|
||||
cargo = rustToolchain;
|
||||
rustc = rustToolchain;
|
||||
}
|
||||
);
|
||||
rustPlatform =
|
||||
if cargoBuildTarget != null then
|
||||
baseRustPlatform.overrideScope (
|
||||
final: prev: {
|
||||
cargoBuildHook = prev.cargoBuildHook.overrideDerivation (_: {
|
||||
rustcTargetSpec = cargoBuildTarget;
|
||||
});
|
||||
cargoInstallHook = hello;
|
||||
rustPlatformFor =
|
||||
pkgs:
|
||||
let
|
||||
rust-bin = rust-overlay.lib.mkRustBin { } pkgs;
|
||||
rustToolchain = (rust-bin.fromRustupToolchainFile ../rust-toolchain.toml).override (
|
||||
if cargoBuildTarget != null then
|
||||
{
|
||||
targets = [ cargoBuildTarget ];
|
||||
}
|
||||
else
|
||||
{ }
|
||||
);
|
||||
baseRustPlatform = (
|
||||
pkgs.makeRustPlatform {
|
||||
cargo = rustToolchain;
|
||||
rustc = rustToolchain;
|
||||
}
|
||||
)
|
||||
else
|
||||
baseRustPlatform;
|
||||
);
|
||||
rustPlatform =
|
||||
if cargoBuildTarget != null then
|
||||
baseRustPlatform.overrideScope (
|
||||
final: prev: {
|
||||
cargoBuildHook = prev.cargoBuildHook.overrideDerivation (_: {
|
||||
rustcTargetSpec = cargoBuildTarget;
|
||||
});
|
||||
cargoInstallHook = hello;
|
||||
}
|
||||
)
|
||||
else
|
||||
baseRustPlatform;
|
||||
in
|
||||
rustPlatform;
|
||||
in
|
||||
rustPlatform.buildRustPackage (
|
||||
(rustPlatformFor pkgs).buildRustPackage (
|
||||
# rustPlatform.buildRustPackage (
|
||||
{
|
||||
pname = "organic";
|
||||
version = cargoToml.package.version;
|
||||
|
||||
Reference in New Issue
Block a user