nixpkgs/pkgs/servers/nosql/victoriametrics/default.nix
2022-10-08 04:24:50 +00:00

42 lines
1.4 KiB
Nix

{ lib, buildGoModule, fetchFromGitHub, nixosTests }:
buildGoModule rec {
pname = "VictoriaMetrics";
version = "1.82.0";
src = fetchFromGitHub {
owner = pname;
repo = pname;
rev = "v${version}";
sha256 = "sha256-JIl2WeveDoAHzqJ2cqMxpWeNf4yQC9fIdfECOJywJ2A=";
};
vendorSha256 = null;
postPatch = ''
# main module (github.com/VictoriaMetrics/VictoriaMetrics) does not contain package
# github.com/VictoriaMetrics/VictoriaMetrics/app/vmui/packages/vmui/web
#
# This appears to be some kind of test server for development purposes only.
rm -f app/vmui/packages/vmui/web/{go.mod,main.go}
# Increase timeouts in tests to prevent failure on heavily loaded builders
substituteInPlace lib/storage/storage_test.go \
--replace "time.After(10 " "time.After(120 " \
--replace "time.After(30 " "time.After(120 "
'';
ldflags = [ "-s" "-w" "-X github.com/VictoriaMetrics/VictoriaMetrics/lib/buildinfo.Version=${version}" ];
passthru.tests = { inherit (nixosTests) victoriametrics; };
meta = with lib; {
homepage = "https://victoriametrics.com/";
description = "fast, cost-effective and scalable time series database, long-term remote storage for Prometheus";
license = licenses.asl20;
maintainers = with maintainers; [ yorickvp ivan ];
changelog = "https://github.com/VictoriaMetrics/VictoriaMetrics/releases/tag/v${version}";
platforms = [ "x86_64-linux" ];
};
}