2019-07-06 21:14:58 +02:00
|
|
|
{
|
|
|
|
stdenv, fetchzip,
|
|
|
|
|
2019-11-28 00:19:38 +01:00
|
|
|
iptables ? null,
|
2019-07-06 21:14:58 +02:00
|
|
|
iproute ? null,
|
|
|
|
libmnl ? null,
|
|
|
|
makeWrapper ? null,
|
|
|
|
openresolv ? null,
|
|
|
|
procps ? 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 {
|
2019-07-06 21:14:58 +02:00
|
|
|
pname = "wireguard-tools";
|
2019-12-19 01:18:13 +01:00
|
|
|
version = "0.0.20191219";
|
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";
|
2019-12-19 01:18:13 +01:00
|
|
|
sha256 = "1qxpjvj3927xdly022rp2sndbifmr0c2y6ik77v43k95ch94716d";
|
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-12-29 16:41:04 +01:00
|
|
|
nativeBuildInputs = [ makeWrapper ];
|
2018-09-29 14:01:21 +02:00
|
|
|
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-12-29 16:41:04 +01:00
|
|
|
'' + optionalString stdenv.isLinux ''
|
|
|
|
for f in $out/bin/*; do
|
2019-11-28 00:19:38 +01:00
|
|
|
wrapProgram $f --prefix PATH : ${makeBinPath [procps iproute iptables openresolv]}
|
2018-12-29 16:41:04 +01:00
|
|
|
done
|
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
|
|
|
'';
|
|
|
|
|
2019-06-01 22:17:25 +02:00
|
|
|
passthru.updateScript = ./update.sh;
|
|
|
|
|
2019-07-06 21:14:58 +02:00
|
|
|
meta = {
|
2018-05-22 03:17:09 +02:00
|
|
|
description = "Tools for the WireGuard secure network tunnel";
|
2019-07-06 21:14:58 +02:00
|
|
|
downloadPage = "https://git.zx2c4.com/WireGuard/refs/";
|
|
|
|
homepage = "https://www.wireguard.com/";
|
2018-05-22 03:17:09 +02:00
|
|
|
license = licenses.gpl2;
|
2019-10-18 23:49:35 +02:00
|
|
|
maintainers = with maintainers; [ elseym ericsagnes mic92 zx2c4 globin ma27 ];
|
2018-05-22 03:17:09 +02:00
|
|
|
platforms = platforms.unix;
|
2018-05-18 23:52:41 +02:00
|
|
|
};
|
|
|
|
}
|