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

33 lines
868 B
Nix
Raw Normal View History

{ stdenv, kernel, wireguard-tools, perl }:
2016-07-11 17:05:23 +01:00
# module requires Linux >= 3.10 https://www.wireguard.io/install/#kernel-requirements
assert stdenv.lib.versionAtLeast kernel.version "3.10";
2019-08-13 22:52:01 +01:00
stdenv.mkDerivation {
pname = "wireguard";
inherit (wireguard-tools) src version;
2016-07-11 17:05:23 +01: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 = [ perl ] ++ kernel.moduleBuildDependencies;
buildFlags = [ "module" ];
installTargets = [ "module-install" ];
meta = with stdenv.lib; {
inherit (wireguard-tools.meta) homepage license maintainers;
description = "Kernel module for the WireGuard secure network tunnel";
platforms = platforms.linux;
};
}