2018-05-22 03:17:09 +02:00
|
|
|
{ stdenv, fetchzip, libmnl ? null, makeWrapper ? null, wireguard-go ? null }:
|
2018-05-18 23:52:41 +02:00
|
|
|
|
2018-05-22 03:17:09 +02:00
|
|
|
with stdenv.lib;
|
2018-05-18 23:52:41 +02:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
name = "wireguard-tools-${version}";
|
2018-10-23 11:32:02 +02:00
|
|
|
version = "0.0.20181018";
|
2018-05-18 23:52:41 +02:00
|
|
|
|
2018-05-19 12:08:04 +02:00
|
|
|
src = fetchzip {
|
2018-05-22 03:17:09 +02:00
|
|
|
url = "https://git.zx2c4.com/WireGuard/snapshot/WireGuard-${version}.tar.xz";
|
2018-10-23 11:32:02 +02:00
|
|
|
sha256 = "0vrr0f89nrpwnyia6kqvrjkxwivrnvjnbavmx2nxlrb3sz23481y";
|
2018-05-18 23:52:41 +02:00
|
|
|
};
|
|
|
|
|
2018-05-22 03:17:09 +02:00
|
|
|
sourceRoot = "source/src/tools";
|
2018-05-18 23:52:41 +02:00
|
|
|
|
2018-09-29 14:01:21 +02:00
|
|
|
nativeBuildInputs = optional stdenv.isDarwin makeWrapper;
|
|
|
|
buildInputs = optional stdenv.isLinux libmnl;
|
2018-05-18 23:52:41 +02:00
|
|
|
|
|
|
|
makeFlags = [
|
|
|
|
"DESTDIR=$(out)"
|
|
|
|
"PREFIX=/"
|
2018-05-22 03:17:09 +02:00
|
|
|
"WITH_BASHCOMPLETION=yes"
|
|
|
|
"WITH_SYSTEMDUNITS=yes"
|
|
|
|
"WITH_WGQUICK=yes"
|
2018-05-18 23:52:41 +02:00
|
|
|
];
|
|
|
|
|
2018-05-22 03:17:09 +02:00
|
|
|
postFixup = ''
|
2018-05-18 23:52:41 +02:00
|
|
|
substituteInPlace $out/lib/systemd/system/wg-quick@.service \
|
|
|
|
--replace /usr/bin $out/bin
|
2018-05-22 03:17:09 +02:00
|
|
|
'' + optionalString stdenv.isDarwin ''
|
|
|
|
for f in $out/bin/*; do
|
|
|
|
wrapProgram $f --prefix PATH : ${wireguard-go}/bin
|
|
|
|
done
|
2018-05-18 23:52:41 +02:00
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with stdenv.lib; {
|
2018-05-22 03:17:09 +02:00
|
|
|
description = "Tools for the WireGuard secure network tunnel";
|
2018-05-18 23:52:41 +02:00
|
|
|
downloadPage = https://git.zx2c4.com/WireGuard/refs/;
|
2018-05-22 03:17:09 +02:00
|
|
|
homepage = https://www.wireguard.com/;
|
|
|
|
license = licenses.gpl2;
|
|
|
|
maintainers = with maintainers; [ ericsagnes mic92 zx2c4 ];
|
|
|
|
platforms = platforms.unix;
|
2018-05-18 23:52:41 +02:00
|
|
|
};
|
|
|
|
}
|