forked from EspressoSystems/espresso-sequencer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
cross-shell.nix
30 lines (26 loc) · 893 Bytes
/
cross-shell.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
# A simplest nix shell file with the project dependencies and
# a cross-compilation support.
{ pkgs, RUSTFLAGS, RUST_LOG, RUST_BACKTRACE, CARGO_TARGET_DIR }:
pkgs.mkShell {
# Native project dependencies like build utilities and additional routines
# like container building, linters, etc.
nativeBuildInputs = with pkgs.pkgsBuildHost; [
# Rust
(rust-bin.stable.latest.minimal.override {
extensions = [ "rustfmt" "clippy" "llvm-tools-preview" "rust-src" ];
})
# Will add some dependencies like libiconv
rustBuildHostDependencies
# Crate dependencies
cargoDeps.openssl-sys
protobuf # required by libp2p
capnproto
openssh
];
# Libraries essential to build the service binaries
buildInputs = with pkgs; [
# Enable Rust cross-compilation support
rustCrossHook
];
inherit RUSTFLAGS RUST_LOG RUST_BACKTRACE CARGO_TARGET_DIR;
}