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";
|
2023-03-04 12:14:45 +00:00
|
|
|
version = "0.0.20230223";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchzip {
|
|
|
|
url = "https://git.zx2c4.com/wireguard-go/snapshot/wireguard-go-${version}.tar.xz";
|
2023-03-04 12:14:45 +00:00
|
|
|
sha256 = "sha256-ZVWbZwSpxQvxwySS3cfzdRReFtHWk6LT2AuIe10hyz0=";
|
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
|
|
|
|
'';
|
|
|
|
|
2023-03-04 12:14:45 +00:00
|
|
|
vendorHash = "sha256-i6ncA71R0hi1SzqCLphhtF3yRAHDmOdYJQ6pf3UDBg8=";
|
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
|
|
|
};
|
|
|
|
}
|