@@ -1,11 +1,18 @@
1−{ stdenv, kernel, wireguard-tools, perl }:
1+{ stdenv, fetchzip, kernel, perl, wireguard-tools }:
22
33# module requires Linux >= 3.10 https://www.wireguard.io/install/#kernel-requirements
44assert stdenv.lib.versionAtLeast kernel.version "3.10";
5+# wireguard upstreamed since 5.6 https://lists.zx2c4.com/pipermail/wireguard/2019-December/004704.html
6+assert stdenv.lib.versionOlder kernel.version "5.6";
57
6−stdenv.mkDerivation {
8+stdenv.mkDerivation rec {
79 pname = "wireguard";
8− inherit (wireguard-tools) src version;
10+ version = "0.0.20191226";
11+
12+ src = fetchzip {
13+ url = "https://git.zx2c4.com/wireguard-linux-compat/snapshot/wireguard-linux-compat-${version}.tar.xz";
14+ sha256 = "1q618h385kqnzxa8xswnw9i1yqrlnl3fglkhbzc8w1181qr4fhra";
15+ };
916
1017 preConfigure = ''
1118 cd src
@@ -27,6 +34,7 @@ stdenv.mkDerivation {
2734 meta = with stdenv.lib; {
2835 inherit (wireguard-tools.meta) homepage license maintainers;
2936 description = "Kernel module for the WireGuard secure network tunnel";
37+ downloadPage = "https://git.zx2c4.com/wireguard-linux-compat/refs/";
3038 platforms = platforms.linux;
3139 };
3240}