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