2022-12-17 10:02:37 +00:00
|
|
|
{ lib
|
|
|
|
, buildGoModule
|
|
|
|
, fetchFromGitHub
|
|
|
|
, buildNpmPackage
|
|
|
|
}:
|
|
|
|
let
|
2023-01-20 10:41:00 +00:00
|
|
|
version = "0.3.6";
|
2022-12-17 10:02:37 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "zinclabs";
|
|
|
|
repo = "zinc";
|
|
|
|
rev = "v${version}";
|
2023-01-20 10:41:00 +00:00
|
|
|
sha256 = "sha256-7pPVX/jdHN7EMss6/uRZqJO+zDfDLZv/iG5iboB+s64=";
|
2022-12-17 10:02:37 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
webui = buildNpmPackage {
|
|
|
|
inherit src version;
|
|
|
|
pname = "zinc-ui";
|
|
|
|
|
|
|
|
sourceRoot = "source/web";
|
|
|
|
|
|
|
|
npmDepsHash = "sha256-clRijS+hxWc1LwlAKjEEk/6XPBYC6CcLq5g/ry4a04g=";
|
|
|
|
|
|
|
|
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
|
|
|
|
'';
|
|
|
|
|
2023-01-20 10:41:00 +00:00
|
|
|
vendorHash = "sha256-akjb0cxHbITKS26c+7lVSHWO/KRoQVVKzAOra+tdAD8=";
|
2022-12-17 10:02:37 +00:00
|
|
|
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 ];
|
|
|
|
};
|
|
|
|
}
|