2018-05-19 12:08:04 +02:00
|
|
|
{ stdenv, lib, fetchzip, libmnl, useSystemd ? stdenv.isLinux }:
|
2018-05-18 23:52:41 +02:00
|
|
|
|
|
|
|
let
|
|
|
|
inherit (lib) optional optionalString;
|
|
|
|
in
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
name = "wireguard-tools-${version}";
|
2018-05-20 19:13:23 +02:00
|
|
|
version = "0.0.20180519";
|
2018-05-18 23:52:41 +02:00
|
|
|
|
2018-05-19 12:08:04 +02:00
|
|
|
src = fetchzip {
|
2018-05-18 23:52:41 +02:00
|
|
|
url = "https://git.zx2c4.com/WireGuard/snapshot/WireGuard-${version}.tar.xz";
|
2018-05-20 19:13:23 +02:00
|
|
|
sha256 = "0pd04ia0wcm0f6di4gx5kflccc5j35d72j38l8jqpj8vinl6l070";
|
2018-05-18 23:52:41 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
preConfigure = "cd src";
|
|
|
|
|
|
|
|
buildInputs = optional stdenv.isLinux libmnl;
|
|
|
|
|
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
|
|
|
makeFlags = [
|
|
|
|
"WITH_BASHCOMPLETION=yes"
|
|
|
|
"WITH_WGQUICK=yes"
|
|
|
|
"WITH_SYSTEMDUNITS=${if useSystemd then "yes" else "no"}"
|
|
|
|
"DESTDIR=$(out)"
|
|
|
|
"PREFIX=/"
|
|
|
|
"-C" "tools"
|
|
|
|
];
|
|
|
|
|
|
|
|
buildPhase = "make tools";
|
|
|
|
|
|
|
|
postInstall = optionalString useSystemd ''
|
|
|
|
substituteInPlace $out/lib/systemd/system/wg-quick@.service \
|
|
|
|
--replace /usr/bin $out/bin
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with stdenv.lib; {
|
|
|
|
homepage = https://www.wireguard.com/;
|
|
|
|
downloadPage = https://git.zx2c4.com/WireGuard/refs/;
|
2018-05-22 02:52:47 +02:00
|
|
|
description = "Tools for the WireGuard secure network tunnel";
|
2018-05-18 23:52:41 +02:00
|
|
|
maintainers = with maintainers; [ ericsagnes mic92 zx2c4 ];
|
|
|
|
license = licenses.gpl2;
|
|
|
|
platforms = platforms.unix;
|
|
|
|
};
|
|
|
|
}
|