2022-06-16 17:23:12 +00:00
|
|
|
{ lib, buildGoModule, fetchzip, testers, wireguard-go }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-06-16 17:23:12 +00:00
|
|
|
buildGoModule rec {
|
2020-04-24 23:36:52 +00:00
|
|
|
pname = "wireguard-go";
|
2022-06-16 17:23:12 +00:00
|
|
|
version = "0.0.20220316";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchzip {
|
|
|
|
url = "https://git.zx2c4.com/wireguard-go/snapshot/wireguard-go-${version}.tar.xz";
|
2022-06-16 17:23:12 +00:00
|
|
|
sha256 = "sha256-OQiG92idGwOXWX4H4HNmk2dmRM2+GtssJFzavhj1HxM=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2022-06-16 17:23:12 +00:00
|
|
|
postPatch = ''
|
|
|
|
# Skip formatting tests
|
|
|
|
rm -f format_test.go
|
|
|
|
'';
|
|
|
|
|
|
|
|
vendorSha256 = "sha256-MrHkOj0YfvAm8zOowXzl23F1NPTCO0F8vMMGT/Y+nQ0=";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-06-16 17:23:12 +00:00
|
|
|
subPackages = [ "." ];
|
|
|
|
|
|
|
|
ldflags = [ "-s" "-w" ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2020-05-29 06:06:01 +00:00
|
|
|
postInstall = ''
|
|
|
|
mv $out/bin/wireguard $out/bin/wireguard-go
|
|
|
|
'';
|
|
|
|
|
2022-06-16 17:23:12 +00:00
|
|
|
passthru.tests.version = testers.testVersion {
|
|
|
|
package = wireguard-go;
|
|
|
|
version = "v${version}";
|
|
|
|
};
|
2021-08-25 08:27:29 +00:00
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Userspace Go implementation of WireGuard";
|
|
|
|
homepage = "https://git.zx2c4.com/wireguard-go/about/";
|
2021-08-25 08:27:29 +00:00
|
|
|
license = licenses.mit;
|
2022-07-14 12:49:19 +00:00
|
|
|
maintainers = with maintainers; [ kirelagin yana zx2c4 ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|