feat: Update flakes with proper wasm compilation
Some checks failed
build / codecov (push) Waiting to run
build / checks-matrix (push) Failing after 3h14m3s
docs / docs (push) Failing after 3h14m1s
build / checks-build (push) Has been cancelled

This commit is contained in:
2026-02-25 16:06:55 +05:30
parent 1b47ed48ea
commit 17d21dbc66
2 changed files with 28 additions and 19 deletions

11
flake.lock generated
View File

@@ -34,10 +34,10 @@
"crates-io-index": { "crates-io-index": {
"flake": false, "flake": false,
"locked": { "locked": {
"lastModified": 1763363725, "lastModified": 1772013874,
"narHash": "sha256-cxr5xIKZFP45yV1ZHFTB1sHo5YGiR3FA8D9vAfDizMo=", "narHash": "sha256-WwDhEeVOnAfH1PKpqHNdGFylmbtmTk5hk7cS+0C6Scg=",
"ref": "refs/heads/master", "ref": "refs/heads/master",
"rev": "0382002e816a4cbd17d8d5b172f08b848aa22ff6", "rev": "94b5f7911c9131b53988424c964f721a3f22714d",
"shallow": true, "shallow": true,
"type": "git", "type": "git",
"url": "https://github.com/rust-lang/crates.io-index" "url": "https://github.com/rust-lang/crates.io-index"
@@ -50,7 +50,9 @@
}, },
"crates-nix": { "crates-nix": {
"inputs": { "inputs": {
"crates-io-index": "crates-io-index" "crates-io-index": [
"crates-io-index"
]
}, },
"locked": { "locked": {
"lastModified": 1763364255, "lastModified": 1763364255,
@@ -124,6 +126,7 @@
"inputs": { "inputs": {
"advisory-db": "advisory-db", "advisory-db": "advisory-db",
"crane": "crane", "crane": "crane",
"crates-io-index": "crates-io-index",
"crates-nix": "crates-nix", "crates-nix": "crates-nix",
"flake-utils": "flake-utils", "flake-utils": "flake-utils",
"nix-github-actions": "nix-github-actions", "nix-github-actions": "nix-github-actions",

View File

@@ -9,7 +9,6 @@
url = "github:nix-community/nix-github-actions"; url = "github:nix-community/nix-github-actions";
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
}; };
crates-nix.url = "github:uttarayan21/crates.nix";
rust-overlay = { rust-overlay = {
url = "github:oxalica/rust-overlay"; url = "github:oxalica/rust-overlay";
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
@@ -18,6 +17,14 @@
url = "github:rustsec/advisory-db"; url = "github:rustsec/advisory-db";
flake = false; flake = false;
}; };
crates-io-index = {
url = "git+https://github.com/rust-lang/crates.io-index?shallow=1";
flake = false;
};
crates-nix = {
url = "github:uttarayan21/crates.nix";
inputs.crates-io-index.follows = "crates-io-index";
};
}; };
outputs = { outputs = {
@@ -55,9 +62,14 @@
craneLib = (crane.mkLib pkgs).overrideToolchain toolchain; craneLib = (crane.mkLib pkgs).overrideToolchain toolchain;
craneLibLLvmTools = (crane.mkLib pkgs).overrideToolchain toolchainWithLLvmTools; craneLibLLvmTools = (crane.mkLib pkgs).overrideToolchain toolchainWithLLvmTools;
crates = crates-nix.mkLib {inherit pkgs;};
lockedCrateVersion = crateName: lockFile: ((builtins.elemAt (builtins.filter (item: item.name == crateName) (builtins.fromTOML (builtins.readFile lockFile)).package)) 0).version;
src = let src = let
filterBySuffix = path: exts: lib.any (ext: lib.hasSuffix ext path) exts; filterBySuffix = path: exts: lib.any (ext: lib.hasSuffix ext path) exts;
sourceFilters = path: type: (craneLib.filterCargoSources path type) || filterBySuffix path [".c" ".h" ".hpp" ".cpp" ".cc"]; sourceFilters = path: type:
(craneLib.filterCargoSources path type)
|| filterBySuffix path [".html"];
in in
lib.cleanSourceWith { lib.cleanSourceWith {
filter = sourceFilters; filter = sourceFilters;
@@ -87,8 +99,11 @@
libiconv libiconv
apple-sdk_26 apple-sdk_26
]); ]);
wasm-bindgen-cli = crates.buildCrate "wasm-bindgen-cli" {
version = lockedCrateVersion "wasm-bindgen" ./Cargo.lock;
}; };
cargoArtifacts = craneLib.buildPackage commonArgs; };
cargoArtifacts = craneLib.buildTrunkPackage commonArgs;
in { in {
checks = checks =
{ {
@@ -123,19 +138,10 @@
}; };
packages = let packages = let
pkg = craneLib.buildPackage (commonArgs pkg = craneLib.buildTrunkPackage (
commonArgs
// {inherit cargoArtifacts;} // {inherit cargoArtifacts;}
// { );
postInstall = ''
mkdir -p $out/bin
mkdir -p $out/share/bash-completions
mkdir -p $out/share/fish/vendor_completions.d
mkdir -p $out/share/zsh/site-functions
$out/bin/${name} completions bash > $out/share/bash-completions/${name}.bash
$out/bin/${name} completions fish > $out/share/fish/vendor_completions.d/${name}.fish
$out/bin/${name} completions zsh > $out/share/zsh/site-functions/_${name}
'';
});
in { in {
"${name}" = pkg; "${name}" = pkg;
default = pkg; default = pkg;