nixpkgs/pkgs/os-specific/linux/wireguard/default.nix
Frederik Rietdijk 419bc0a4cd Revert "Revert "Merge master into staging-next""
In 87a19e9048 I merged staging-next into master using the GitHub gui as intended.
In ac241fb7a5 I merged master into staging-next for the next staging cycle, however, I accidentally pushed it to master.
Thinking this may cause trouble, I reverted it in 0be87c7979. This was however wrong, as it "removed" master.

This reverts commit 0be87c7979.
2020-02-05 19:41:25 +01:00

41 lines
1.3 KiB
Nix

{ stdenv, fetchzip, kernel, perl, wireguard-tools }:
# module requires Linux >= 3.10 https://www.wireguard.io/install/#kernel-requirements
assert stdenv.lib.versionAtLeast kernel.version "3.10";
# wireguard upstreamed since 5.6 https://lists.zx2c4.com/pipermail/wireguard/2019-December/004704.html
assert stdenv.lib.versionOlder kernel.version "5.6";
stdenv.mkDerivation rec {
pname = "wireguard";
version = "0.0.20200205";
src = fetchzip {
url = "https://git.zx2c4.com/wireguard-linux-compat/snapshot/wireguard-linux-compat-${version}.tar.xz";
sha256 = "084bvjhfqxvbh5wv7a2cj8k1i1lfix2l9972xwr36hw9kvqpynnm";
};
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";
downloadPage = "https://git.zx2c4.com/wireguard-linux-compat/refs/";
platforms = platforms.linux;
};
}