Merge pull request #85984 from Mic92/wireguard
This commit is contained in:
commit
ef959a1d9b
@ -1,4 +1,4 @@
|
|||||||
{ stdenv, fetchzip, kernel, perl, wireguard-tools }:
|
{ stdenv, fetchzip, kernel, perl, wireguard-tools, bc }:
|
||||||
|
|
||||||
# module requires Linux >= 3.10 https://www.wireguard.io/install/#kernel-requirements
|
# module requires Linux >= 3.10 https://www.wireguard.io/install/#kernel-requirements
|
||||||
assert stdenv.lib.versionAtLeast kernel.version "3.10";
|
assert stdenv.lib.versionAtLeast kernel.version "3.10";
|
||||||
@ -7,29 +7,31 @@ assert stdenv.lib.versionOlder kernel.version "5.6";
|
|||||||
|
|
||||||
stdenv.mkDerivation rec {
|
stdenv.mkDerivation rec {
|
||||||
pname = "wireguard";
|
pname = "wireguard";
|
||||||
version = "1.0.20200401";
|
version = "1.0.20200413";
|
||||||
|
|
||||||
src = fetchzip {
|
src = fetchzip {
|
||||||
url = "https://git.zx2c4.com/wireguard-linux-compat/snapshot/wireguard-linux-compat-${version}.tar.xz";
|
url = "https://git.zx2c4.com/wireguard-linux-compat/snapshot/wireguard-linux-compat-${version}.tar.xz";
|
||||||
sha256 = "1q4gfpbvbyracnl219xqfz5yqfc08i6g41z6bn2skx5x8jbll3aq";
|
sha256 = "11dpw1inszbc3qjcfnap74kgjxkyyrx90vxv6wmsgkbp8lsl4p66";
|
||||||
};
|
};
|
||||||
|
|
||||||
preConfigure = ''
|
|
||||||
cd src
|
|
||||||
sed -i '/depmod/,+1d' Makefile
|
|
||||||
'';
|
|
||||||
|
|
||||||
hardeningDisable = [ "pic" ];
|
hardeningDisable = [ "pic" ];
|
||||||
|
|
||||||
KERNELDIR = "${kernel.dev}/lib/modules/${kernel.modDirVersion}/build";
|
KERNELDIR = "${kernel.dev}/lib/modules/${kernel.modDirVersion}/build";
|
||||||
INSTALL_MOD_PATH = "\${out}";
|
|
||||||
|
|
||||||
NIX_CFLAGS = ["-Wno-error=cpp"];
|
nativeBuildInputs = [ perl bc ] ++ kernel.moduleBuildDependencies;
|
||||||
|
|
||||||
nativeBuildInputs = [ perl ] ++ kernel.moduleBuildDependencies;
|
|
||||||
|
|
||||||
|
preBuild = "cd src";
|
||||||
buildFlags = [ "module" ];
|
buildFlags = [ "module" ];
|
||||||
installTargets = [ "module-install" ];
|
|
||||||
|
INSTALL_MOD_PATH = placeholder "out";
|
||||||
|
installFlags = [ "DEPMOD=true" ];
|
||||||
|
enableParallelBuilding = true;
|
||||||
|
|
||||||
|
passthru = {
|
||||||
|
# remove this when our kernel comes with native wireguard support
|
||||||
|
# and our tests no longer tests this package
|
||||||
|
inherit (wireguard-tools) tests;
|
||||||
|
};
|
||||||
|
|
||||||
meta = with stdenv.lib; {
|
meta = with stdenv.lib; {
|
||||||
inherit (wireguard-tools.meta) homepage license maintainers;
|
inherit (wireguard-tools.meta) homepage license maintainers;
|
||||||
|
@ -1,12 +1,12 @@
|
|||||||
{
|
{ stdenv
|
||||||
stdenv, fetchzip,
|
, fetchzip
|
||||||
|
, nixosTests
|
||||||
iptables ? null,
|
, iptables ? null
|
||||||
iproute ? null,
|
, iproute ? null
|
||||||
makeWrapper ? null,
|
, makeWrapper ? null
|
||||||
openresolv ? null,
|
, openresolv ? null
|
||||||
procps ? null,
|
, procps ? null
|
||||||
wireguard-go ? null,
|
, wireguard-go ? null
|
||||||
}:
|
}:
|
||||||
|
|
||||||
with stdenv.lib;
|
with stdenv.lib;
|
||||||
@ -47,7 +47,12 @@ stdenv.mkDerivation rec {
|
|||||||
done
|
done
|
||||||
'';
|
'';
|
||||||
|
|
||||||
passthru.updateScript = ./update.sh;
|
passthru = {
|
||||||
|
updateScript = ./update.sh;
|
||||||
|
tests = {
|
||||||
|
inherit (nixosTests) wireguard wg-quick wireguard-generated wireguard-namespaces;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
meta = {
|
meta = {
|
||||||
description = "Tools for the WireGuard secure network tunnel";
|
description = "Tools for the WireGuard secure network tunnel";
|
||||||
|
Loading…
Reference in New Issue
Block a user