examples: drop nixpkgs-for-wasm-bindgen

The examples were already hard coding a concrete version of
wasm-bindgen-cli so having the extra input was both useless and
confusing
This commit is contained in:
Ivan Petkov 2024-11-18 13:20:45 -08:00
parent 9f515d0197
commit 30ad43e875
4 changed files with 16 additions and 41 deletions

View File

@ -4,10 +4,6 @@
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
# The version of wasm-bindgen-cli needs to match the version in Cargo.lock
# Update this to include the version you need
nixpkgs-for-wasm-bindgen.url = "github:NixOS/nixpkgs/4e6868b1aa3766ab1de169922bb3826143941973";
crane.url = "github:ipetkov/crane";
flake-utils.url = "github:numtide/flake-utils";
@ -18,7 +14,7 @@
};
};
outputs = { self, nixpkgs, crane, flake-utils, rust-overlay, nixpkgs-for-wasm-bindgen, ... }:
outputs = { self, nixpkgs, crane, flake-utils, rust-overlay, ... }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs {
@ -33,11 +29,7 @@
# wasm32-unknown-unknown is required for trunk.
targets = [ "wasm32-unknown-unknown" ];
};
craneLib = ((crane.mkLib pkgs).overrideToolchain rustToolchainFor).overrideScope (_final: _prev: {
# The version of wasm-bindgen-cli needs to match the version in Cargo.lock. You
# can unpin this if your nixpkgs commit contains the appropriate wasm-bindgen-cli version
inherit (import nixpkgs-for-wasm-bindgen { inherit system; }) wasm-bindgen-cli;
});
craneLib = (crane.mkLib pkgs).overrideToolchain rustToolchainFor;
# When filtering sources, we want to allow assets other than .rs files
unfilteredRoot = ./.; # The original, unfiltered source
@ -113,6 +105,12 @@
version = "0.2.93";
hash = "sha256-DDdu5mM3gneraM85pAepBXWn3TMofarVR4NbjMdz3r0=";
cargoHash = "sha256-birrg+XABBHHKJxfTKAMSlmTVYLmnmqMDfRnmG6g/YQ=";
# When updating to a new version comment out the above two lines and
# uncomment the bottom two lines. Then try to do a build, which will fail
# but will print out the correct value for `hash`. Replace the value and then
# repeat the process but this time the printed value will be for `cargoHash`
# hash = lib.fakeHash;
# cargoHash = lib.fakeHash;
};
});
in

View File

@ -4,10 +4,6 @@
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
# The version of wasm-bindgen-cli needs to match the version in Cargo.lock
# Update this to include the version you need
nixpkgs-for-wasm-bindgen.url = "github:NixOS/nixpkgs/4e6868b1aa3766ab1de169922bb3826143941973";
crane.url = "github:ipetkov/crane";
flake-utils.url = "github:numtide/flake-utils";
@ -18,7 +14,7 @@
};
};
outputs = { self, nixpkgs, crane, flake-utils, rust-overlay, nixpkgs-for-wasm-bindgen, ... }:
outputs = { self, nixpkgs, crane, flake-utils, rust-overlay, ... }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs {
@ -33,11 +29,7 @@
# wasm32-unknown-unknown is required for trunk
targets = [ "wasm32-unknown-unknown" ];
};
craneLib = ((crane.mkLib pkgs).overrideToolchain rustToolchainFor).overrideScope (_final: _prev: {
# The version of wasm-bindgen-cli needs to match the version in Cargo.lock. You
# can unpin this if your nixpkgs commit contains the appropriate wasm-bindgen-cli version
inherit (import nixpkgs-for-wasm-bindgen { inherit system; }) wasm-bindgen-cli;
});
craneLib = (crane.mkLib pkgs).overrideToolchain rustToolchainFor;
# When filtering sources, we want to allow assets other than .rs files
unfilteredRoot = ./.; # The original, unfiltered source
@ -87,6 +79,12 @@
version = "0.2.93";
hash = "sha256-DDdu5mM3gneraM85pAepBXWn3TMofarVR4NbjMdz3r0=";
cargoHash = "sha256-birrg+XABBHHKJxfTKAMSlmTVYLmnmqMDfRnmG6g/YQ=";
# When updating to a new version comment out the above two lines and
# uncomment the bottom two lines. Then try to do a build, which will fail
# but will print out the correct value for `hash`. Replace the value and then
# repeat the process but this time the printed value will be for `cargoHash`
# hash = lib.fakeHash;
# cargoHash = lib.fakeHash;
};
});

View File

@ -102,22 +102,6 @@
"type": "github"
}
},
"nixpkgs-for-wasm-bindgen": {
"locked": {
"lastModified": 1691495139,
"narHash": "sha256-+zZIRTtXlA8gN8HPzczphPnB9L+yYpidBmFxKqWQy+A=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "4e6868b1aa3766ab1de169922bb3826143941973",
"type": "github"
},
"original": {
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "4e6868b1aa3766ab1de169922bb3826143941973",
"type": "github"
}
},
"nixpkgs-latest-release": {
"locked": {
"lastModified": 1730651795,
@ -142,7 +126,6 @@
"flake-compat": "flake-compat",
"flake-utils": "flake-utils",
"nixpkgs": "nixpkgs",
"nixpkgs-for-wasm-bindgen": "nixpkgs-for-wasm-bindgen",
"nixpkgs-latest-release": "nixpkgs-latest-release",
"rust-overlay": "rust-overlay"
}

View File

@ -4,10 +4,6 @@
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
nixpkgs-latest-release.url = "github:NixOS/nixpkgs/release-24.05";
# The version of wasm-bindgen-cli needs to match the version in Cargo.lock
# Update this to include the version you need
nixpkgs-for-wasm-bindgen.url = "github:NixOS/nixpkgs/4e6868b1aa3766ab1de169922bb3826143941973";
advisory-db = {
url = "github:rustsec/advisory-db";
flake = false;