Merge pull request #197566 from dit7ya/zincsearch

This commit is contained in:
Sandro 2022-12-07 01:34:33 +01:00 committed by GitHub
commit 0c0281fcdf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 58 additions and 0 deletions

View file

@ -0,0 +1,56 @@
{ lib
, buildGoModule
, fetchFromGitHub
, buildNpmPackage
}:
let
version = "0.3.5";
src = fetchFromGitHub {
owner = "zinclabs";
repo = "zinc";
rev = "v${version}";
sha256 = "sha256-qu3foI5Rnt2sf+B+roJOwUNvOfawKmcKq7UrmviQsHA=";
};
webui = buildNpmPackage {
inherit src version;
pname = "zinc-ui";
sourceRoot = "source/web";
npmDepsHash = "sha256-Ao/kDryui4thurqap/d/+82z058HoF2ZJSVKQqVwfVg=";
CYPRESS_INSTALL_BINARY = 0; # cypress tries to download binaries otherwise
installPhase = ''
mkdir -p $out/share
mv dist $out/share/zinc-ui
'';
};
in
buildGoModule rec {
pname = "zinc";
inherit src version;
preBuild = ''
cp -r ${webui}/share/zinc-ui web/dist
'';
vendorSha256 = "sha256-akjb0cxHbITKS26c+7lVSHWO/KRoQVVKzAOra+tdAD8=";
subPackages = [ "cmd/zinc" ];
CGO_ENABLED = 0;
ldflags = [
"-s"
"-w"
"-X github.com/zinclabs/zinc/pkg/meta.Version=${version}"
];
meta = with lib; {
description = "A lightweight alternative to elasticsearch that requires minimal resources, written in Go";
homepage = "https://github.com/zinclabs/zinc";
license = licenses.asl20;
maintainers = with maintainers; [ dit7ya ];
};
}

View file

@ -13363,6 +13363,8 @@ with pkgs;
zip = callPackage ../tools/archivers/zip { };
zinc = callPackage ../servers/search/zinc { };
zkfuse = callPackage ../tools/filesystems/zkfuse { };
zpaq = callPackage ../tools/archivers/zpaq { };