17 ui_version = "OSS-v${version}";
18 libflux_version = "0.193.0";
20 src = fetchFromGitHub {
24 hash = "sha256-JWu4V2k8ItbzBa421EtzgMVlDznoDdGjIhfDSaZ0j6c=";
28 url = "https://github.com/influxdata/ui/releases/download/${ui_version}/build.tar.gz";
29 hash = "sha256-0k59SKvt9pFt3WSd5PRUThbfbctt2RYtaxaxoyLICm8=";
32 flux = rustPlatform.buildRustPackage {
34 version = "v${libflux_version}";
35 src = fetchFromGitHub {
38 rev = "v${libflux_version}";
39 hash = "sha256-gx6vnGOFu35wasLl7X/73eDsE0/50cAzjmBjZ+H2Ne4=";
42 # Fix build with recent rust versions
44 url = "https://github.com/influxdata/flux/commit/6dc8054cfeec4b65b5c7ae786d633240868b8589.patch";
47 excludes = [ "rust-toolchain.toml" ];
48 hash = "sha256-w3z+Z26Xhy9TNICyNhc8XiWNSpdLA23ADI4K/AOMYhg=";
50 ./no-deny-warnings.patch
52 sourceRoot = "${src.name}/libflux";
53 cargoSha256 = "sha256-MoI5nxLGA/3pduZ+vgmSG3lm3Nx58SP+6WXQl2pX9Lc=";
54 nativeBuildInputs = [ rustPlatform.bindgenHook ];
55 buildInputs = lib.optional stdenv.isDarwin libiconv;
58 Version: ${libflux_version}
59 Description: Library for the InfluxData Flux engine
60 Cflags: -I/out/include
61 Libs: -L/out/lib -lflux -lpthread
63 passAsFile = [ "pkgcfg" ];
65 mkdir -p $out/include $out/pkgconfig
66 cp -r $NIX_BUILD_TOP/source/libflux/include/influxdata $out/include
67 substitute $pkgcfgPath $out/pkgconfig/flux.pc \
69 '' + lib.optionalString stdenv.isDarwin ''
70 install_name_tool -id $out/lib/libflux.dylib $out/lib/libflux.dylib
79 nativeBuildInputs = [ go-bindata pkg-config perl ];
81 vendorHash = "sha256-5b1WRq3JndkOkKBhMzGZnSyBDY5Lk0UGe/WGHQJp0CQ=";
82 subPackages = [ "cmd/influxd" "cmd/telemetryd" ];
84 PKG_CONFIG_PATH = "${flux}/pkgconfig";
87 # use go-bindata from environment
88 substituteInPlace static/static.go \
89 --replace 'go run github.com/kevinburke/go-bindata/' ""
92 # Check that libflux and the UI are at the right version, and embed
93 # the UI assets into the Go source tree.
96 flux_ver=$(grep github.com/influxdata/flux go.mod | awk '{print $2}')
97 if [ "$flux_ver" != "v${libflux_version}" ]; then
98 echo "go.mod wants libflux $flux_ver, but nix derivation provides ${libflux_version}"
102 ui_ver=$(egrep 'UI_RELEASE=".*"' scripts/fetch-ui-assets.sh | cut -d'"' -f2)
103 if [ "$ui_ver" != "${ui_version}" ]; then
104 echo "scripts/fetch-ui-assets.sh wants UI $ui_ver, but nix derivation provides ${ui_version}"
110 tar -xzf ${ui} -C static/data
118 ldflags = [ "-X main.commit=v${version}" "-X main.version=${version}" ];
120 passthru.tests = { inherit (nixosTests) influxdb2; };
123 description = "An open-source distributed time series database";
124 license = licenses.mit;
125 homepage = "https://influxdata.com/";
126 maintainers = with maintainers; [ abbradar danderson ];