-
Notifications
You must be signed in to change notification settings - Fork 107
/
ci.nix
75 lines (66 loc) · 1.64 KB
/
ci.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
{ rust ? "stable"
, spdk ? "develop"
, spdk-path ? null
} @ args:
let
sources = import ./nix/sources.nix;
pkgs = import sources.nixpkgs {
overlays = [
(_: _: { inherit sources; })
(import ./nix/overlay.nix { })
];
};
# python environment for test/python
pytest_inputs = with pkgs; python3.withPackages
(ps: with ps; [ virtualenv grpcio grpcio-tools asyncssh black ]);
shellAttrs = import ./spdk-rs/nix/shell {
inherit rust;
inherit spdk;
inherit spdk-path;
inherit sources;
inherit pkgs;
cfg = {
buildInputs = with pkgs; [
docker
docker-compose
e2fsprogs
etcd
gdb
git
gnuplot
kubernetes-helm
nodejs-18_x
numactl
pytest_inputs
udev
libnvme
nvme-cli
xfsprogs
nixpkgs-fmt
];
shellEnv = with pkgs; {
PROTOC = io-engine.PROTOC;
PROTOC_INCLUDE = io-engine.PROTOC_INCLUDE;
ETCD_BIN = "${etcd}/bin/etcd";
LVM_BINS = "${lvm2.bin}/bin";
};
shellHook = ''
# SRCDIR is needed by docker-compose files as it requires absolute paths
export SRCDIR=`pwd`
export PATH="$PATH:$(pwd)/scripts/nix-sudo"
export IO_ENGINE_DIR="$RUST_TARGET_DEBUG"
'';
shellInfoHook = ''
echo
echo "PROTOC : $PROTOC"
echo "PROTOC_INCLUDE : $PROTOC_INCLUDE"
echo "ETCD_BIN : $ETCD_BIN"
echo "LVM path : $LVM_BINS"
echo "I/O engine dir : $IO_ENGINE_DIR"
'';
};
};
in
pkgs.mkShell shellAttrs // {
name = "io-engine-dev-shell";
}