2022-04-23 00:34:22 +00:00
|
|
|
{ lib, buildGoModule, fetchFromGitHub }:
|
2018-03-22 13:16:14 +00:00
|
|
|
|
2022-04-23 00:34:22 +00:00
|
|
|
buildGoModule rec {
|
2019-08-15 12:41:18 +00:00
|
|
|
pname = "toxiproxy";
|
2022-09-12 04:46:34 +00:00
|
|
|
version = "2.5.0";
|
2022-04-23 00:34:22 +00:00
|
|
|
|
2018-03-22 13:16:14 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "Shopify";
|
|
|
|
repo = "toxiproxy";
|
|
|
|
rev = "v${version}";
|
2022-09-12 04:46:34 +00:00
|
|
|
sha256 = "sha256-SL3YHsNeFw8K8lPrzJXAoTkHxS+1sTREfzjawBxdnf0=";
|
2018-03-22 13:16:14 +00:00
|
|
|
};
|
|
|
|
|
2023-09-13 04:44:46 +00:00
|
|
|
vendorHash = "sha256-CmENxPAdjz0BAyvhLKIaJjSbK/mvRzHGCQOfGIiA3yI=";
|
2022-04-23 00:34:22 +00:00
|
|
|
|
|
|
|
excludedPackages = [ "test/e2e" ];
|
|
|
|
|
|
|
|
ldflags = [ "-s" "-w" "-X github.com/Shopify/toxiproxy/v2.Version=${version}" ];
|
|
|
|
|
2022-10-05 22:17:32 +00:00
|
|
|
# Fixes tests on Darwin
|
|
|
|
__darwinAllowLocalNetworking = true;
|
|
|
|
|
2022-04-23 00:34:22 +00:00
|
|
|
checkFlags = [ "-short" ];
|
2018-03-22 13:16:14 +00:00
|
|
|
|
|
|
|
postInstall = ''
|
2020-04-28 01:50:57 +00:00
|
|
|
mv $out/bin/cli $out/bin/toxiproxy-cli
|
2022-04-23 00:34:22 +00:00
|
|
|
mv $out/bin/server $out/bin/toxiproxy-server
|
2018-03-22 13:16:14 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
meta = {
|
2020-10-11 05:55:05 +00:00
|
|
|
description = "Proxy for for simulating network conditions";
|
2022-04-23 00:34:22 +00:00
|
|
|
homepage = "https://github.com/Shopify/toxiproxy";
|
2018-03-22 13:16:14 +00:00
|
|
|
maintainers = with lib.maintainers; [ avnik ];
|
2018-08-04 14:37:55 +00:00
|
|
|
license = lib.licenses.mit;
|
2018-03-22 13:16:14 +00:00
|
|
|
};
|
|
|
|
}
|