diff options
author | Yt <raphael@megzari.com> | 2024-06-17 01:17:53 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-06-17 01:17:53 +0000 |
commit | a7363cc71168cb7ddfc326e74f5e1cba4d8328f9 (patch) | |
tree | aaa00366f188cf382dd59702c9078a7c1e6ef49c /pkgs | |
parent | 3bc13a61700f4b6c41a8daa4539cbe7dd030a92c (diff) | |
parent | 6e577b6da1bcbf7c8463805d88518e15561071dc (diff) |
Merge pull request #320342 from jpds/quickwit-enable-ui
quickwit: enable UI
Diffstat (limited to 'pkgs')
-rw-r--r-- | pkgs/servers/search/quickwit/default.nix | 55 |
1 files changed, 52 insertions, 3 deletions
diff --git a/pkgs/servers/search/quickwit/default.nix b/pkgs/servers/search/quickwit/default.nix index 095bfc679aa47..e99289b089545 100644 --- a/pkgs/servers/search/quickwit/default.nix +++ b/pkgs/servers/search/quickwit/default.nix @@ -7,14 +7,20 @@ , protobuf , rust-jemalloc-sys , Security +, nodejs +, yarn +, fetchYarnDeps +, fixup-yarn-lock }: let pname = "quickwit"; version = "0.8.1"; -in -rustPlatform.buildRustPackage rec { - inherit pname version; + + yarnOfflineCache = fetchYarnDeps { + yarnLock = "${src}/quickwit/quickwit-ui/yarn.lock"; + hash = "sha256-HppK9ycUxCOIagvzCmE+VfcmfMQfPIC8WeWM6WbA6fQ="; + }; src = fetchFromGitHub { owner = "quickwit-oss"; @@ -23,6 +29,41 @@ rustPlatform.buildRustPackage rec { hash = "sha256-B5U9nzXh6kj3/UnQzM3//h4hn9ippWHbeDMcMTP9XfM="; }; + quickwit-ui = stdenv.mkDerivation { + name = "quickwit-ui"; + src = "${src}/quickwit/quickwit-ui"; + + nativeBuildInputs = [ + nodejs + yarn + fixup-yarn-lock + ]; + + configurePhase = '' + export HOME=$(mktemp -d) + ''; + + buildPhase = '' + yarn config --offline set yarn-offline-mirror ${yarnOfflineCache} + fixup-yarn-lock yarn.lock + + yarn install --offline \ + --frozen-lockfile --no-progress \ + --ignore-engines --ignore-scripts + patchShebangs . + + yarn build + ''; + + installPhase = '' + mkdir $out + mv build/* $out + ''; + }; +in +rustPlatform.buildRustPackage rec { + inherit pname version src; + postPatch = '' substituteInPlace ./quickwit-ingest/build.rs \ --replace-fail '.with_protos' '.with_includes(&["."]).with_protos' @@ -34,6 +75,11 @@ rustPlatform.buildRustPackage rec { sourceRoot = "${src.name}/quickwit"; + preBuild = '' + mkdir -p quickwit-ui/build + cp -r ${quickwit-ui}/* quickwit-ui/build + ''; + buildInputs = [ rust-jemalloc-sys ] ++ lib.optionals stdenv.isDarwin [ Security ]; @@ -50,6 +96,9 @@ rustPlatform.buildRustPackage rec { }; }; + CARGO_PROFILE_RELEASE_LTO = "fat"; + CARGO_PROFILE_RELEASE_CODEGEN_UNITS = "1"; + # needed for internal protobuf c wrapper library PROTOC = "${protobuf}/bin/protoc"; PROTOC_INCLUDE = "${protobuf}/include"; |