forked from Blockstream/lwk
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflake.nix
43 lines (39 loc) · 1.1 KB
/
flake.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
{
description = "wasm-pack setup";
inputs = {
nixpkgs = { url = "github:nixos/nixpkgs/nixos-24.11"; };
rust-overlay = {
url = "github:oxalica/rust-overlay";
inputs = {
nixpkgs.follows = "nixpkgs";
};
};
};
outputs = { nixpkgs, rust-overlay, ... }:
let system = "x86_64-linux";
in {
devShell.${system} =
let
pkgs = import nixpkgs {
inherit system;
overlays = [ rust-overlay.overlays.default ];
};
in
(({ pkgs, ... }:
pkgs.mkShell {
buildInputs = with pkgs; [
cargo
wasm-pack
clang_15
nodejs_22
(rust-bin.stable.latest.default.override {
extensions = [ "rust-src" ];
targets = [ "wasm32-unknown-unknown" ];
})
];
CC_wasm32_unknown_unknown = "clang-15";
CFLAGS_wasm32_unknown_unknown = "-I${pkgs.clang_15}/resource-root/include";
RUSTFLAGS = "--cfg=web_sys_unstable_apis";
}) { pkgs = pkgs; });
};
}