2022-12-17 10:02:37 +00:00
|
|
|
{ lib
|
|
|
|
, buildGoModule
|
|
|
|
, fetchFromGitHub
|
|
|
|
, buildNpmPackage
|
|
|
|
}:
|
2023-07-15 17:15:38 +00:00
|
|
|
|
2022-12-17 10:02:37 +00:00
|
|
|
let
|
2023-07-15 17:15:38 +00:00
|
|
|
version = "0.4.7";
|
2022-12-17 10:02:37 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "zinclabs";
|
2023-07-15 17:15:38 +00:00
|
|
|
repo = "zincsearch";
|
2022-12-17 10:02:37 +00:00
|
|
|
rev = "v${version}";
|
2023-07-15 17:15:38 +00:00
|
|
|
hash = "sha256-6ZwEH9Xm+iIZ0SDa8qb82lIN3KU6DMe2wt0q9doKgkE=";
|
2022-12-17 10:02:37 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
webui = buildNpmPackage {
|
|
|
|
inherit src version;
|
|
|
|
pname = "zinc-ui";
|
|
|
|
|
2023-08-04 22:07:22 +00:00
|
|
|
sourceRoot = "${src.name}/web";
|
2022-12-17 10:02:37 +00:00
|
|
|
|
2023-07-15 17:15:38 +00:00
|
|
|
npmDepsHash = "sha256-2AjUaEOn2Tj+X4f42SvNq1kX07WxkB1sl5KtGdCjbdw=";
|
2022-12-17 10:02:37 +00:00
|
|
|
|
2023-07-15 17:15:38 +00:00
|
|
|
env = {
|
|
|
|
CYPRESS_INSTALL_BINARY = 0; # cypress tries to download binaries otherwise
|
|
|
|
};
|
2022-12-17 10:02:37 +00:00
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out/share
|
|
|
|
mv dist $out/share/zinc-ui
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
in
|
2023-07-15 17:15:38 +00:00
|
|
|
|
2022-12-17 10:02:37 +00:00
|
|
|
buildGoModule rec {
|
2023-07-15 17:15:38 +00:00
|
|
|
pname = "zincsearch";
|
2022-12-17 10:02:37 +00:00
|
|
|
inherit src version;
|
|
|
|
|
|
|
|
preBuild = ''
|
|
|
|
cp -r ${webui}/share/zinc-ui web/dist
|
|
|
|
'';
|
|
|
|
|
2023-07-15 17:15:38 +00:00
|
|
|
vendorHash = "sha256-/uZh50ImKWW7vYMfRqTbTAMUoRTZ9jXMbc3K16wYJkE=";
|
|
|
|
subPackages = [ "cmd/zincsearch" ];
|
2022-12-17 10:02:37 +00:00
|
|
|
|
|
|
|
ldflags = [
|
|
|
|
"-s"
|
|
|
|
"-w"
|
2023-07-15 17:15:38 +00:00
|
|
|
"-X github.com/zinclabs/zincsearch/pkg/meta.Version=${version}"
|
2022-12-17 10:02:37 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "A lightweight alternative to elasticsearch that requires minimal resources, written in Go";
|
2023-07-15 17:15:38 +00:00
|
|
|
homepage = "https://zinc.dev";
|
2022-12-17 10:02:37 +00:00
|
|
|
license = licenses.asl20;
|
|
|
|
maintainers = with maintainers; [ dit7ya ];
|
|
|
|
};
|
|
|
|
}
|