nixpkgs/pkgs/os-specific/linux/wireguard/default.nix
Kirill Elagin 865abfa609
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.
2018-05-19 01:17:26 +03:00

40 lines
1.1 KiB
Nix

{ stdenv, fetchurl, kernel }:
# module requires Linux >= 3.10 https://www.wireguard.io/install/#kernel-requirements
assert stdenv.lib.versionAtLeast kernel.version "3.10";
stdenv.mkDerivation rec {
name = "wireguard-${version}";
version = "0.0.20180514";
src = fetchurl {
url = "https://git.zx2c4.com/WireGuard/snapshot/WireGuard-${version}.tar.xz";
sha256 = "1nk6yj1gdmpar99zzw39n1v795m6fxsrilg37d02jm780rgbd5g8";
};
preConfigure = ''
cd src
sed -i '/depmod/,+1d' Makefile
'';
hardeningDisable = [ "pic" ];
KERNELDIR = "${kernel.dev}/lib/modules/${kernel.modDirVersion}/build";
INSTALL_MOD_PATH = "\${out}";
NIX_CFLAGS = ["-Wno-error=cpp"];
nativeBuildInputs = kernel.moduleBuildDependencies;
buildPhase = "make module";
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.linux;
};
}