Pass in rust-overlay for creating rust-bin.
Some checks failed
rust-test Build rust-test has started
format Build format has succeeded
clippy Build clippy has failed
build Build build has succeeded
foreign-document-test Build foreign-document-test has failed

This commit is contained in:
Tom Alexander
2026-07-10 21:48:42 -04:00
parent 957bb3a5c8
commit 842a77fb2b
2 changed files with 53 additions and 39 deletions

View File

@@ -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,7 +129,12 @@
); );
in in
{ {
library = (organicScope.callPackage ./nix/package.nix { buildLib = true; }).overrideAttrs ( library =
(organicScope.callPackage ./nix/package.nix {
inherit rust-overlay;
buildLib = true;
}).overrideAttrs
(
old: old:
let let
in in
@@ -140,6 +146,7 @@
} }
); );
devTools = organicScope.callPackage ./nix/package.nix { devTools = organicScope.callPackage ./nix/package.nix {
inherit rust-overlay;
targetBins = [ targetBins = [
"parse" "parse"
"compare" "compare"

View File

@@ -1,8 +1,8 @@
{ {
hello, hello,
lib, lib,
makeRustPlatform, pkgs,
rust-bin, rust-overlay,
targetBins ? [ ], targetBins ? [ ],
features ? [ ], features ? [ ],
@@ -12,6 +12,10 @@
}: }:
let let
cargoToml = (lib.importTOML ../Cargo.toml); cargoToml = (lib.importTOML ../Cargo.toml);
rustPlatformFor =
pkgs:
let
rust-bin = rust-overlay.lib.mkRustBin { } pkgs;
rustToolchain = (rust-bin.fromRustupToolchainFile ../rust-toolchain.toml).override ( rustToolchain = (rust-bin.fromRustupToolchainFile ../rust-toolchain.toml).override (
if cargoBuildTarget != null then if cargoBuildTarget != null then
{ {
@@ -21,7 +25,7 @@ let
{ } { }
); );
baseRustPlatform = ( baseRustPlatform = (
makeRustPlatform { pkgs.makeRustPlatform {
cargo = rustToolchain; cargo = rustToolchain;
rustc = rustToolchain; rustc = rustToolchain;
} }
@@ -39,7 +43,10 @@ let
else else
baseRustPlatform; baseRustPlatform;
in in
rustPlatform.buildRustPackage ( rustPlatform;
in
(rustPlatformFor pkgs).buildRustPackage (
# rustPlatform.buildRustPackage (
{ {
pname = "organic"; pname = "organic";
version = cargoToml.package.version; version = cargoToml.package.version;