2 Commits

Author SHA1 Message Date
Tom Alexander
842a77fb2b 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
2026-07-10 21:55:12 -04:00
Tom Alexander
957bb3a5c8 Remove pkgsBuildHost from devShell. 2026-07-10 21:55:12 -04:00
2 changed files with 56 additions and 42 deletions

View File

@@ -35,9 +35,9 @@
pkgs = import nixpkgs {
inherit system overlays;
};
rustToolchain =
(pkgs.pkgsBuildHost.rust-bin.fromRustupToolchainFile ./rust-toolchain.toml).override
{ targets = [ "wasm32-unknown-unknown" ]; };
rustToolchain = (pkgs.rust-bin.fromRustupToolchainFile ./rust-toolchain.toml).override {
targets = [ "wasm32-unknown-unknown" ];
};
in
{
default = pkgs.mkShell {
@@ -96,6 +96,7 @@
bindgenTarget ? null,
}:
(organicScope.callPackage ./nix/package.nix {
inherit rust-overlay;
targetBins = [
"wasm"
];
@@ -128,7 +129,12 @@
);
in
{
library = (organicScope.callPackage ./nix/package.nix { buildLib = true; }).overrideAttrs (
library =
(organicScope.callPackage ./nix/package.nix {
inherit rust-overlay;
buildLib = true;
}).overrideAttrs
(
old:
let
in
@@ -140,6 +146,7 @@
}
);
devTools = organicScope.callPackage ./nix/package.nix {
inherit rust-overlay;
targetBins = [
"parse"
"compare"

View File

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