forked from foundationdb-rs/foundationdb-rs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflake.nix
76 lines (67 loc) · 2.18 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
{
description = "A dev environment for the crate foundationdb-rs";
inputs = {
nixpkgs.url = "nixpkgs";
rust-overlay.url = "github:oxalica/rust-overlay";
rust-overlay.inputs.nixpkgs.follows = "nixpkgs";
fdb-overlay.url = "github:foundationdb-rs/overlay";
fdb-overlay.inputs.nixpkgs.follows = "nixpkgs";
};
outputs = all@{ self, nixpkgs, fdb-overlay, rust-overlay, ... }: {
# Utilized by `nix develop`
devShells.x86_64-linux.default =
let
rustChannel = "stable";
overlays = [ (import rust-overlay) fdb-overlay.overlays.default ];
pkgs = import nixpkgs {
inherit overlays;
system = "x86_64-linux";
};
in
with pkgs;
mkShell {
buildInputs = [
# bindgen part
clang
llvmPackages.libclang
llvmPackages.libcxxClang
pkg-config
# Rust part
cargo-expand
cargo-edit
cargo-msrv
# uncomment when https://github.com/NixOS/nixpkgs/issues/354058 is fixed
# cargo-llvm-cov
cargo-audit
rust-analyzer
(rust-bin.${rustChannel}.latest.default.override {
extensions = [
"cargo"
"clippy"
"rust-src"
"rustc"
"rustfmt"
"rust-analyzer"
"llvm-tools-preview"
];
})
git-cliff
release-plz
# FDB part
libfdb73
# bindingTester part
python3
virtualenv
];
# https://github.com/NixOS/nixpkgs/issues/52447#issuecomment-853429315
BINDGEN_EXTRA_CLANG_ARGS = "-isystem ${llvmPackages.libclang.lib}/lib/clang/${lib.getVersion clang}/include";
LIBCLANG_PATH = "${llvmPackages.libclang.lib}/lib";
FDB_CLIENT_LIB_PATH = "${libfdb73}/include";
LD_LIBRARY_PATH = "${libfdb73}/include";
# To import with Intellij IDEA
RUST_TOOLCHAIN_PATH = "${pkgs.rust-bin.${rustChannel}.latest.default}/bin";
RUST_SRC_PATH = "${pkgs.rust-bin.${rustChannel}.latest.rust-src}/lib/rustlib/src/rust/library";
RUST_BACKTRACE = "1";
};
};
}