Skip to content

Commit 0fc9241

Browse files
committed
Add nix flake
1 parent 70a47c9 commit 0fc9241

File tree

2 files changed

+112
-0
lines changed

2 files changed

+112
-0
lines changed

flake.lock

Lines changed: 61 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flake.nix

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
{
2+
description = "openmina prerequisites";
3+
4+
inputs = {
5+
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
6+
utils.url = "github:numtide/flake-utils";
7+
};
8+
9+
outputs = { self, nixpkgs, utils }:
10+
utils.lib.eachDefaultSystem (system:
11+
let
12+
pkgs = import nixpkgs { inherit system; };
13+
in
14+
{
15+
devShell = pkgs.mkShell {
16+
buildInputs = with pkgs; [
17+
rustup
18+
rust-analyzer
19+
libiconv # Needed for macOS for rustup
20+
21+
openssl
22+
jemalloc
23+
protobuf
24+
libpcap
25+
26+
pkg-config
27+
gcc
28+
gnumake
29+
30+
curl
31+
git
32+
sqlite
33+
nodejs
34+
35+
shellcheck
36+
];
37+
38+
# To use wasm-pack and other executables installed via `cargo install`
39+
shellHook = ''
40+
export PATH=$HOME/.cargo/bin:$PATH
41+
'';
42+
43+
# Fix for tikv-jemalloc-sys compilation error on GNU platforms:
44+
# The GNU version of strerror_r returns char* while POSIX returns int.
45+
# Only set this flag on Linux/GNU systems, not needed on macOS.
46+
CFLAGS = if pkgs.stdenv.isLinux then "-DJEMALLOC_STRERROR_R_RETURNS_CHAR_WITH_GNU_SOURCE" else "";
47+
JEMALLOC_SYS_WITH_CFLAGS = if pkgs.stdenv.isLinux then "-DJEMALLOC_STRERROR_R_RETURNS_CHAR_WITH_GNU_SOURCE" else "";
48+
};
49+
}
50+
);
51+
}

0 commit comments

Comments
 (0)