forked from foundationdb-rs/foundationdb-rs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
62 lines (55 loc) · 1.89 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
{
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
rust-analyzer
(rust-bin.${rustChannel}.latest.default.override {
extensions = [ "rust-src" ];
})
rust-bin.${rustChannel}.latest.rustfmt
rust-bin.${rustChannel}.latest.clippy
# FDB part
libfdb
# 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 = "${libfdb}/include";
LD_LIBRARY_PATH = "${libfdb}/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";
};
};
}