Skip to content

Commit fea61e0

Browse files
committed
Add nix flake
1 parent cf67d94 commit fea61e0

File tree

2 files changed

+100
-0
lines changed

2 files changed

+100
-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: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
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+
31+
# Fix for tikv-jemalloc-sys compilation error on GNU platforms:
32+
# The GNU version of strerror_r returns char* while POSIX returns int.
33+
# Only set this flag on Linux/GNU systems, not needed on macOS.
34+
CFLAGS = if pkgs.stdenv.isLinux then "-DJEMALLOC_STRERROR_R_RETURNS_CHAR_WITH_GNU_SOURCE" else "";
35+
JEMALLOC_SYS_WITH_CFLAGS = if pkgs.stdenv.isLinux then "-DJEMALLOC_STRERROR_R_RETURNS_CHAR_WITH_GNU_SOURCE" else "";
36+
};
37+
}
38+
);
39+
}

0 commit comments

Comments
 (0)