2022-04-05 10:24:44 +00:00
|
|
|
{ lib, buildGoModule, fetchzip, testers, wireguard-go }:
|
2018-05-19 08:15:26 +00:00
|
|
|
|
2022-04-05 10:24:44 +00:00
|
|
|
buildGoModule rec {
|
2019-08-15 12:41:18 +00:00
|
|
|
pname = "wireguard-go";
|
2023-02-27 08:23:27 +00:00
|
|
|
version = "0.0.20230223";
|
2018-05-19 08:15:26 +00:00
|
|
|
|
2018-05-19 10:01:59 +00:00
|
|
|
src = fetchzip {
|
2018-05-19 08:15:26 +00:00
|
|
|
url = "https://git.zx2c4.com/wireguard-go/snapshot/wireguard-go-${version}.tar.xz";
|
2023-02-27 08:23:27 +00:00
|
|
|
sha256 = "sha256-ZVWbZwSpxQvxwySS3cfzdRReFtHWk6LT2AuIe10hyz0=";
|
2018-05-19 08:15:26 +00:00
|
|
|
};
|
|
|
|
|
2022-04-05 10:24:44 +00:00
|
|
|
postPatch = ''
|
|
|
|
# Skip formatting tests
|
|
|
|
rm -f format_test.go
|
|
|
|
'';
|
|
|
|
|
2023-02-27 08:23:27 +00:00
|
|
|
vendorHash = "sha256-i6ncA71R0hi1SzqCLphhtF3yRAHDmOdYJQ6pf3UDBg8=";
|
2018-05-19 08:15:26 +00:00
|
|
|
|
2022-04-05 10:24:44 +00:00
|
|
|
subPackages = [ "." ];
|
|
|
|
|
|
|
|
ldflags = [ "-s" "-w" ];
|
2019-06-01 20:46:56 +00:00
|
|
|
|
2020-05-22 09:37:54 +00:00
|
|
|
postInstall = ''
|
|
|
|
mv $out/bin/wireguard $out/bin/wireguard-go
|
|
|
|
'';
|
|
|
|
|
2022-04-05 10:24:44 +00:00
|
|
|
passthru.tests.version = testers.testVersion {
|
|
|
|
package = wireguard-go;
|
|
|
|
version = "v${version}";
|
|
|
|
};
|
2021-08-13 10:58:37 +00:00
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2018-05-19 08:15:26 +00:00
|
|
|
description = "Userspace Go implementation of WireGuard";
|
2020-04-01 01:11:51 +00:00
|
|
|
homepage = "https://git.zx2c4.com/wireguard-go/about/";
|
2021-08-16 13:40:31 +00:00
|
|
|
license = licenses.mit;
|
2022-07-04 10:41:44 +00:00
|
|
|
maintainers = with maintainers; [ kirelagin yana zx2c4 ];
|
2018-05-19 08:15:26 +00:00
|
|
|
};
|
|
|
|
}
|