2018-05-19 16:20:33 +02:00
|
|
|
{ stdenv, fetchzip, kernel, wireguard-tools }:
|
2016-07-11 18:05:23 +02:00
|
|
|
|
2017-04-22 23:34:38 +02:00
|
|
|
# module requires Linux >= 3.10 https://www.wireguard.io/install/#kernel-requirements
|
2018-05-18 23:52:41 +02:00
|
|
|
assert stdenv.lib.versionAtLeast kernel.version "3.10";
|
2016-08-11 00:25:57 +02:00
|
|
|
|
2018-05-18 23:52:41 +02:00
|
|
|
stdenv.mkDerivation rec {
|
2016-12-14 22:09:35 +01:00
|
|
|
name = "wireguard-${version}";
|
2018-05-22 02:52:47 +02:00
|
|
|
inherit (wireguard-tools) src version;
|
2016-07-11 18:05:23 +02:00
|
|
|
|
2018-05-18 23:52:41 +02:00
|
|
|
preConfigure = ''
|
|
|
|
cd src
|
|
|
|
sed -i '/depmod/,+1d' Makefile
|
|
|
|
'';
|
2016-07-13 21:15:11 +02:00
|
|
|
|
2018-05-18 23:52:41 +02:00
|
|
|
hardeningDisable = [ "pic" ];
|
2016-07-13 21:15:11 +02:00
|
|
|
|
2018-05-18 23:52:41 +02:00
|
|
|
KERNELDIR = "${kernel.dev}/lib/modules/${kernel.modDirVersion}/build";
|
|
|
|
INSTALL_MOD_PATH = "\${out}";
|
2016-07-13 21:15:11 +02:00
|
|
|
|
2018-05-18 23:52:41 +02:00
|
|
|
NIX_CFLAGS = ["-Wno-error=cpp"];
|
2017-10-09 05:46:32 +02:00
|
|
|
|
2018-05-18 23:52:41 +02:00
|
|
|
nativeBuildInputs = kernel.moduleBuildDependencies;
|
2016-07-13 21:15:11 +02:00
|
|
|
|
2018-05-18 23:52:41 +02:00
|
|
|
buildPhase = "make module";
|
2017-10-09 05:46:32 +02:00
|
|
|
|
2018-05-18 23:52:41 +02:00
|
|
|
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 = "Kernel module 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.linux;
|
2016-07-13 21:15:11 +02:00
|
|
|
};
|
2018-05-18 23:52:41 +02:00
|
|
|
}
|