-
Notifications
You must be signed in to change notification settings - Fork 824
/
flake.nix
79 lines (66 loc) · 2.19 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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
{
description = "Wasmer Webassembly runtime";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.05";
flakeutils.url = "github:numtide/flake-utils";
};
outputs = { self, nixpkgs, flakeutils }:
flakeutils.lib.eachDefaultSystem (system:
let
NAME = "wasmer";
pkgs = import nixpkgs {
inherit system;
};
in
rec {
packages.${NAME} = import ./scripts/nix/pkg.nix pkgs;
defaultPackage = pkgs.callPackage packages.${NAME} pkgs;
# For `nix run`.
apps.${NAME} = flakeutils.lib.mkApp {
drv = packages.${NAME};
};
defaultApp = apps.${NAME};
# Development shell.
# Run "nix develop" to activate.
devShell = pkgs.mkShell {
name = NAME;
src = self;
packages = with pkgs; [
pkg-config
openssl
# LLVM and related dependencies
llvmPackages_18.libllvm
llvmPackages_18.llvm
libxml2
libffi
# Rust tooling
# Snapshot testing
# https://github.com/mitsuhiko/insta
cargo-insta
# Test runner
# https://github.com/nextest-rs/nextest
cargo-nextest
# Rust dependency vulnerability checker
# https://github.com/EmbarkStudios/cargo-deny
cargo-deny
# Webassembly tooling
# "Official" WASM CLI tools
# (wasm2wat, wat2wasm, wasm-objdump, ...)
# https://github.com/WebAssembly/wabt
wabt
# Provides `wasm-opt` (WASM optimizer) and some other tools
# https://github.com/WebAssembly/binaryen
binaryen
# Various WASM debugging and conversion tools
# (partial overlap with "wabt")
# https://github.com/bytecodealliance/wasm-tools
wasm-tools
];
env.LLVM_SYS_180_PREFIX = pkgs.llvmPackages_18.llvm.dev;
# shellHook = ''
# LD_LIBRARY_PATH = "${ env.LD_LIBRARY_PATH = pkgs.lib.makeLibraryPath [ pkgs.stdenv.cc.cc pkgs.openssl.out ] }:$LD_LIBRARY_PATH"
# '';
};
}
);
}