diff options
author | Jonathan Davies <jpds@protonmail.com> | 2024-06-16 18:03:18 +0100 |
---|---|---|
committer | Jonathan Davies <jpds@protonmail.com> | 2024-06-16 23:18:33 +0100 |
commit | 773f17e1df61c9cdf0b03d984b89131f03f9754f (patch) | |
tree | b551c306286791558250e78112c2c8742a5bd496 /pkgs/servers/search | |
parent | b96d99b63d7fa5249643061378087b0c75a70390 (diff) |
quickwit: Enable building UI
Based on patch by Thomas Cheronneau
Diffstat (limited to 'pkgs/servers/search')
-rw-r--r-- | pkgs/servers/search/quickwit/default.nix | 52 |
1 files changed, 49 insertions, 3 deletions
diff --git a/pkgs/servers/search/quickwit/default.nix b/pkgs/servers/search/quickwit/default.nix index 095bfc679aa47..ece87aa43ae27 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 ]; |