nixpkgs/pkgs/tools/networking/clash/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

50 lines
1.0 KiB
Nix
Raw Normal View History

{ lib
, fetchFromGitHub
, buildGoModule
, testers
, clash
}:
2019-12-30 02:18:10 +00:00
buildGoModule rec {
pname = "clash";
2023-08-22 03:11:28 +00:00
version = "1.18.0";
2019-12-30 02:18:10 +00:00
src = fetchFromGitHub {
owner = "Dreamacro";
repo = pname;
2023-08-22 03:11:28 +00:00
rev = "v${version}";
hash = "sha256-LqjSPlPkR5sB4Z1pmpdE9r66NN7pwgE9GK4r1zSFlxs=";
2019-12-30 02:18:10 +00:00
};
2023-08-22 03:11:28 +00:00
vendorHash = "sha256-EWAbEFYr15RiJk9IXF6KaaX4GaSCa6E4+8rKL4/XG8Y=";
2019-12-30 02:18:10 +00:00
2022-05-22 07:50:12 +00:00
# Do not build testing suit
excludedPackages = [ "./test" ];
2022-03-13 14:17:42 +00:00
CGO_ENABLED = 0;
2021-08-26 06:45:51 +00:00
ldflags = [
2022-03-13 14:17:42 +00:00
"-s"
"-w"
"-X github.com/Dreamacro/clash/constant.Version=${version}"
2020-01-02 10:56:51 +00:00
];
2023-08-22 03:11:28 +00:00
checkFlags = [
"-skip=TestParseRule" # Flaky tests
];
passthru.tests.version = testers.testVersion {
2022-03-13 14:17:42 +00:00
package = clash;
command = "clash -v";
};
meta = with lib; {
2019-12-30 02:18:10 +00:00
description = "A rule-based tunnel in Go";
homepage = "https://dreamacro.github.io/clash/";
changelog = "https://github.com/Dreamacro/clash/releases/tag/v${version}";
license = licenses.gpl3Only;
maintainers = with maintainers; [ contrun Br1ght0ne ];
mainProgram = "clash";
2019-12-30 02:18:10 +00:00
};
}