17 ui_version = "OSS-v2.7.1";
18 libflux_version = "0.194.5";
20 src = fetchFromGitHub {
24 hash = "sha256-0gqFUIV0ETdVuVmC+SwoKsO6OkoT/s+qKO1f8fkaZj4=";
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-XHT/+JMu5q1cPjZT2x/OKEPgxFJcnjrQKqn8w9/Mb3s=";
42 # Fix build on Rust 1.78 (included after v0.195.0)
44 name = "fix-build-on-rust-1.78.patch";
45 url = "https://github.com/influxdata/flux/commit/68c831c40b396f0274f6a9f97d77707c39970b02.patch";
49 hash = "sha256-6LOTgbOCfETNTmshyXgtDZf9y4t/2iqRuVPkz9dYPHc=";
51 ./fix-unsigned-char.patch
53 sourceRoot = "${src.name}/libflux";
54 cargoHash = "sha256-O+t4f4P5291BuyARH6Xf3LejMFEQEBv+qKtyjHRhclA=";
55 nativeBuildInputs = [ rustPlatform.bindgenHook ];
56 buildInputs = lib.optional stdenv.hostPlatform.isDarwin libiconv;
59 Version: ${libflux_version}
60 Description: Library for the InfluxData Flux engine
61 Cflags: -I/out/include
62 Libs: -L/out/lib -lflux -lpthread
64 passAsFile = [ "pkgcfg" ];
66 mkdir -p $out/include $out/pkgconfig
67 cp -r $NIX_BUILD_TOP/source/libflux/include/influxdata $out/include
68 substitute $pkgcfgPath $out/pkgconfig/flux.pc \
70 '' + lib.optionalString stdenv.hostPlatform.isDarwin ''
71 install_name_tool -id $out/lib/libflux.dylib $out/lib/libflux.dylib
80 nativeBuildInputs = [ go-bindata pkg-config perl ];
82 vendorHash = "sha256-3Vf8BCrOwliXrH+gmZ4RJ1YBEbqL0Szx2prW3ie9CNg=";
83 subPackages = [ "cmd/influxd" "cmd/telemetryd" ];
85 PKG_CONFIG_PATH = "${flux}/pkgconfig";
88 # use go-bindata from environment
89 substituteInPlace static/static.go \
90 --replace 'go run github.com/kevinburke/go-bindata/' ""
93 # Check that libflux and the UI are at the right version, and embed
94 # the UI assets into the Go source tree.
97 flux_ver=$(grep github.com/influxdata/flux go.mod | awk '{print $2}')
98 if [ "$flux_ver" != "v${libflux_version}" ]; then
99 echo "go.mod wants libflux $flux_ver, but nix derivation provides ${libflux_version}"
103 ui_ver=$(egrep 'UI_RELEASE=".*"' scripts/fetch-ui-assets.sh | cut -d'"' -f2)
104 if [ "$ui_ver" != "${ui_version}" ]; then
105 echo "scripts/fetch-ui-assets.sh wants UI $ui_ver, but nix derivation provides ${ui_version}"
111 tar -xzf ${ui} -C static/data
119 ldflags = [ "-X main.commit=v${version}" "-X main.version=${version}" ];
121 passthru.tests = { inherit (nixosTests) influxdb2; };
124 description = "Open-source distributed time series database";
125 license = licenses.mit;
126 homepage = "https://influxdata.com/";
127 maintainers = with maintainers; [ abbradar ];