Compare commits
3 Commits
main
...
0a10ffa8ff
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0a10ffa8ff
|
||
|
|
5167a9f010
|
||
|
|
14f29298da
|
19
flake.nix
19
flake.nix
@@ -35,9 +35,9 @@
|
|||||||
pkgs = import nixpkgs {
|
pkgs = import nixpkgs {
|
||||||
inherit system overlays;
|
inherit system overlays;
|
||||||
};
|
};
|
||||||
rustToolchain =
|
rustToolchain = (pkgs.rust-bin.fromRustupToolchainFile ./rust-toolchain.toml).override {
|
||||||
(pkgs.pkgsBuildHost.rust-bin.fromRustupToolchainFile ./rust-toolchain.toml).override
|
targets = [ "wasm32-unknown-unknown" ];
|
||||||
{ targets = [ "wasm32-unknown-unknown" ]; };
|
};
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
default = pkgs.mkShell {
|
default = pkgs.mkShell {
|
||||||
@@ -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"
|
||||||
];
|
];
|
||||||
@@ -121,14 +122,19 @@
|
|||||||
'';
|
'';
|
||||||
|
|
||||||
installPhase = ''
|
installPhase = ''
|
||||||
mkdir -p $out/share/${bindgenTarget}
|
mkdir -p $out/share/${bindgenTarget}/wasm
|
||||||
cp target/wasm32-unknown-unknown/${bindgenTarget}/* $out/share/${bindgenTarget}
|
cp target/wasm32-unknown-unknown/${bindgenTarget}/* $out/share/${bindgenTarget}/wasm
|
||||||
'';
|
'';
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
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"
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
{
|
{
|
||||||
hello,
|
hello,
|
||||||
lib,
|
lib,
|
||||||
makeRustPlatform,
|
pkgs,
|
||||||
pkgsBuildHost,
|
rust-overlay,
|
||||||
|
|
||||||
targetBins ? [ ],
|
targetBins ? [ ],
|
||||||
features ? [ ],
|
features ? [ ],
|
||||||
@@ -12,7 +12,11 @@
|
|||||||
}:
|
}:
|
||||||
let
|
let
|
||||||
cargoToml = (lib.importTOML ../Cargo.toml);
|
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
|
if cargoBuildTarget != null then
|
||||||
{
|
{
|
||||||
targets = [ cargoBuildTarget ];
|
targets = [ cargoBuildTarget ];
|
||||||
@@ -21,7 +25,7 @@ let
|
|||||||
{ }
|
{ }
|
||||||
);
|
);
|
||||||
baseRustPlatform = (
|
baseRustPlatform = (
|
||||||
makeRustPlatform {
|
pkgs.makeRustPlatform {
|
||||||
cargo = rustToolchain;
|
cargo = rustToolchain;
|
||||||
rustc = rustToolchain;
|
rustc = rustToolchain;
|
||||||
}
|
}
|
||||||
@@ -38,8 +42,11 @@ let
|
|||||||
)
|
)
|
||||||
else
|
else
|
||||||
baseRustPlatform;
|
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