-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflake.nix
101 lines (86 loc) · 3.44 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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs";
fenix = {
url = "github:nix-community/fenix";
inputs.nixpkgs.follows = "nixpkgs";
};
naersk.url = "github:nix-community/naersk";
};
outputs = {
self,
nixpkgs,
flake-utils,
fenix,
naersk,
}:
flake-utils.lib.eachDefaultSystem (
system: let
pkgs = (import nixpkgs) {
inherit system;
overlays = [
(import ./nix/overlays/hdf5.nix)
];
};
toolchain = fenix.packages.${system}.toolchainOf {
channel = "1.75";
date = "2023-12-28";
sha256 = "SXRtAuO4IqNOQq+nLbrsDFbVk+3aVA8NNpSZsKlVH/8=";
};
naersk' = pkgs.callPackage naersk {
cargo = toolchain.rust;
rustc = toolchain.rust;
};
ws_cargo_toml = builtins.readFile ./Cargo.toml;
ws_cargo = builtins.fromTOML ws_cargo_toml;
version = ws_cargo.workspace.package.version;
git_revision = self.shortRev or self.dirtyShortRev;
hdf5-joined = pkgs.symlinkJoin {
name = "hdf5";
paths = with pkgs; [hdf5 hdf5.dev];
};
nativeBuildInputs = with pkgs; [cmake flatbuffers hdf5-joined perl tcl pkg-config];
buildInputs = with pkgs; [openssl cyrus_sasl hdf5-joined];
lintingRustFlags = "-D unused-crate-dependencies";
in {
devShell = pkgs.mkShell {
nativeBuildInputs = nativeBuildInputs ++ [toolchain.toolchain];
buildInputs = buildInputs;
packages = with pkgs; [
# Newer version of nix is required to use `dirtyShortRev`
nix
# Code formatting tools
alejandra
treefmt
mdl
# Container image management
skopeo
];
RUSTFLAGS = lintingRustFlags;
HDF5_DIR = "${hdf5-joined}";
};
packages =
{
test = naersk'.buildPackage {
mode = "test";
src = ./.;
nativeBuildInputs = nativeBuildInputs;
buildInputs = buildInputs;
HDF5_DIR = "${hdf5-joined}";
# Ensure detailed test output appears in nix build log
cargoTestOptions = x: x ++ ["1>&2"];
};
}
// import ./digitiser-aggregator {inherit pkgs naersk' version git_revision nativeBuildInputs buildInputs;}
// import ./events-to-histogram {inherit pkgs naersk' version git_revision nativeBuildInputs buildInputs;}
// import ./kafka-daq-report {inherit pkgs naersk' version git_revision nativeBuildInputs buildInputs;}
// import ./run-simulator {inherit pkgs naersk' version git_revision nativeBuildInputs buildInputs;}
// import ./simulator {inherit pkgs naersk' version git_revision nativeBuildInputs buildInputs;}
// import ./stream-to-file {inherit pkgs naersk' version git_revision nativeBuildInputs buildInputs hdf5-joined;}
// import ./trace-archiver {inherit pkgs naersk' version git_revision nativeBuildInputs buildInputs hdf5-joined;}
// import ./trace-archiver-tdengine {inherit pkgs naersk' version git_revision nativeBuildInputs buildInputs;}
// import ./trace-reader {inherit pkgs naersk' version git_revision nativeBuildInputs buildInputs;}
// import ./trace-to-events {inherit pkgs naersk' version git_revision nativeBuildInputs buildInputs;};
}
);
}