-
Notifications
You must be signed in to change notification settings - Fork 0
/
default.nix
43 lines (35 loc) · 1021 Bytes
/
default.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
{ pkgs, nixpkgs, system, makeRustPlatform, rust-overlay }:
let
rustPkgs = import nixpkgs {
inherit system;
overlays = [ (import rust-overlay) ];
};
rustVersion = "1.66.0";
wasmUnknownUknown = "wasm32-unknown-unknown";
wasm32Wasi = "wasm32-wasi";
rustDefaultTarget = rustPkgs.rust-bin.stable.${rustVersion}.default;
rustWithWasmTarget = rustPkgs.rust-bin.nightly.${rustVersion}.default.override {
targets = [ wasmUnknownUknown ];
};
rustPlatform = makeRustPlatform {
cargo = rustDefaultTarget;
rustc = rustDefaultTarget;
};
rustPlatformWasm = makeRustPlatform {
cargo = rustWithWasmTarget;
rustc = rustWithWasmTarget;
};
common = {
version = "0.1.0";
src = ./.;
cargoLock = {
lockFile = ./Cargo.lock;
};
nativeBuildInputs = [ pkgs.pkg-config ];
PKG_CONFIG_PATH = "${pkgs.openssl.dev}/lib/pkgconfig";
};
in {
workspace = pkgs.rustPlatformWasm.buildRustPackage (common // {
cargoBuildFlags = "--release --workspace";
});
}