diff options
author | Kirill Elagin <kirelagin@gmail.com> | 2018-05-19 00:52:41 +0300 |
---|---|---|
committer | Kirill Elagin <kirelagin@gmail.com> | 2018-05-19 01:17:26 +0300 |
commit | 865abfa6091515da3c776283500e45d489ed488f (patch) | |
tree | 8ab72e7db92c9a5e37b2c4f9069afda0c7bdaa92 /pkgs/tools | |
parent | bd078c1a313a0eadb8232f3732e9700cc52253b1 (diff) | |
download | nixlib-865abfa6091515da3c776283500e45d489ed488f.tar nixlib-865abfa6091515da3c776283500e45d489ed488f.tar.gz nixlib-865abfa6091515da3c776283500e45d489ed488f.tar.bz2 nixlib-865abfa6091515da3c776283500e45d489ed488f.tar.lz nixlib-865abfa6091515da3c776283500e45d489ed488f.tar.xz nixlib-865abfa6091515da3c776283500e45d489ed488f.tar.zst nixlib-865abfa6091515da3c776283500e45d489ed488f.zip |
wireguard: Enable tools on other platforms
Wireguard is now split into two pretty much independent packages: `wireguard` (Linux-specific kernel module) and `wireguard-tools`, which is cross-platform.
Diffstat (limited to 'pkgs/tools')
-rw-r--r-- | pkgs/tools/networking/wireguard-tools/default.nix | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/pkgs/tools/networking/wireguard-tools/default.nix b/pkgs/tools/networking/wireguard-tools/default.nix new file mode 100644 index 000000000000..8f983082a800 --- /dev/null +++ b/pkgs/tools/networking/wireguard-tools/default.nix @@ -0,0 +1,46 @@ +{ stdenv, lib, fetchurl, libmnl, useSystemd ? stdenv.isLinux }: + +let + inherit (lib) optional optionalString; +in + +stdenv.mkDerivation rec { + name = "wireguard-tools-${version}"; + version = "0.0.20180514"; + + src = fetchurl { + url = "https://git.zx2c4.com/WireGuard/snapshot/WireGuard-${version}.tar.xz"; + sha256 = "1nk6yj1gdmpar99zzw39n1v795m6fxsrilg37d02jm780rgbd5g8"; + }; + + 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/; + description = " Tools for the WireGuard secure network tunnel"; + maintainers = with maintainers; [ ericsagnes mic92 zx2c4 ]; + license = licenses.gpl2; + platforms = platforms.unix; + }; +} |