nixpkgs/pkgs/os-specific/linux/wireguard/default.nix

35 lines
977 B
Nix
Raw Normal View History

{ stdenv, fetchzip, kernel, wireguard-tools }:
2016-07-11 18:05:23 +02:00
# module requires Linux >= 3.10 https://www.wireguard.io/install/#kernel-requirements
assert stdenv.lib.versionAtLeast kernel.version "3.10";
stdenv.mkDerivation rec {
2016-12-14 22:09:35 +01:00
name = "wireguard-${version}";
inherit (wireguard-tools) src version;
2016-07-11 18:05:23 +02:00
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 = "Kernel module for the WireGuard secure network tunnel";
maintainers = with maintainers; [ ericsagnes mic92 zx2c4 ];
license = licenses.gpl2;
platforms = platforms.linux;
};
}