Pass in rust-overlay for creating rust-bin.
This commit is contained in:
29
flake.nix
29
flake.nix
@@ -96,6 +96,7 @@
|
|||||||
bindgenTarget ? null,
|
bindgenTarget ? null,
|
||||||
}:
|
}:
|
||||||
(organicScope.callPackage ./nix/package.nix {
|
(organicScope.callPackage ./nix/package.nix {
|
||||||
|
inherit rust-overlay;
|
||||||
targetBins = [
|
targetBins = [
|
||||||
"wasm"
|
"wasm"
|
||||||
];
|
];
|
||||||
@@ -128,18 +129,24 @@
|
|||||||
);
|
);
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
library = (organicScope.callPackage ./nix/package.nix { buildLib = true; }).overrideAttrs (
|
library =
|
||||||
old:
|
(organicScope.callPackage ./nix/package.nix {
|
||||||
let
|
inherit rust-overlay;
|
||||||
in
|
buildLib = true;
|
||||||
{
|
}).overrideAttrs
|
||||||
installPhase = ''
|
(
|
||||||
mkdir -p $out/lib
|
old:
|
||||||
cp target/*/release/liborganic.rlib $out/lib/
|
let
|
||||||
'';
|
in
|
||||||
}
|
{
|
||||||
);
|
installPhase = ''
|
||||||
|
mkdir -p $out/lib
|
||||||
|
cp target/*/release/liborganic.rlib $out/lib/
|
||||||
|
'';
|
||||||
|
}
|
||||||
|
);
|
||||||
devTools = organicScope.callPackage ./nix/package.nix {
|
devTools = organicScope.callPackage ./nix/package.nix {
|
||||||
|
inherit rust-overlay;
|
||||||
targetBins = [
|
targetBins = [
|
||||||
"parse"
|
"parse"
|
||||||
"compare"
|
"compare"
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
{
|
{
|
||||||
hello,
|
hello,
|
||||||
lib,
|
lib,
|
||||||
makeRustPlatform,
|
pkgs,
|
||||||
rust-bin,
|
rust-overlay,
|
||||||
|
|
||||||
targetBins ? [ ],
|
targetBins ? [ ],
|
||||||
features ? [ ],
|
features ? [ ],
|
||||||
@@ -12,34 +12,41 @@
|
|||||||
}:
|
}:
|
||||||
let
|
let
|
||||||
cargoToml = (lib.importTOML ../Cargo.toml);
|
cargoToml = (lib.importTOML ../Cargo.toml);
|
||||||
rustToolchain = (rust-bin.fromRustupToolchainFile ../rust-toolchain.toml).override (
|
rustPlatformFor =
|
||||||
if cargoBuildTarget != null then
|
pkgs:
|
||||||
{
|
let
|
||||||
targets = [ cargoBuildTarget ];
|
rust-bin = rust-overlay.lib.mkRustBin { } pkgs;
|
||||||
}
|
rustToolchain = (rust-bin.fromRustupToolchainFile ../rust-toolchain.toml).override (
|
||||||
else
|
if cargoBuildTarget != null then
|
||||||
{ }
|
{
|
||||||
);
|
targets = [ cargoBuildTarget ];
|
||||||
baseRustPlatform = (
|
}
|
||||||
makeRustPlatform {
|
else
|
||||||
cargo = rustToolchain;
|
{ }
|
||||||
rustc = rustToolchain;
|
);
|
||||||
}
|
baseRustPlatform = (
|
||||||
);
|
pkgs.makeRustPlatform {
|
||||||
rustPlatform =
|
cargo = rustToolchain;
|
||||||
if cargoBuildTarget != null then
|
rustc = rustToolchain;
|
||||||
baseRustPlatform.overrideScope (
|
|
||||||
final: prev: {
|
|
||||||
cargoBuildHook = prev.cargoBuildHook.overrideDerivation (_: {
|
|
||||||
rustcTargetSpec = cargoBuildTarget;
|
|
||||||
});
|
|
||||||
cargoInstallHook = hello;
|
|
||||||
}
|
}
|
||||||
)
|
);
|
||||||
else
|
rustPlatform =
|
||||||
baseRustPlatform;
|
if cargoBuildTarget != null then
|
||||||
|
baseRustPlatform.overrideScope (
|
||||||
|
final: prev: {
|
||||||
|
cargoBuildHook = prev.cargoBuildHook.overrideDerivation (_: {
|
||||||
|
rustcTargetSpec = cargoBuildTarget;
|
||||||
|
});
|
||||||
|
cargoInstallHook = hello;
|
||||||
|
}
|
||||||
|
)
|
||||||
|
else
|
||||||
|
baseRustPlatform;
|
||||||
|
in
|
||||||
|
rustPlatform;
|
||||||
in
|
in
|
||||||
rustPlatform.buildRustPackage (
|
(rustPlatformFor pkgs).buildRustPackage (
|
||||||
|
# rustPlatform.buildRustPackage (
|
||||||
{
|
{
|
||||||
pname = "organic";
|
pname = "organic";
|
||||||
version = cargoToml.package.version;
|
version = cargoToml.package.version;
|
||||||
|
|||||||
Reference in New Issue
Block a user