@@ -5180,3 +5180,20 @@ retrieving configuration of WireGuard network tunnel interfaces, and a patch
that can be applied to a Linux kernel source tree in order to build it with
WireGuard support.")
(license license:gpl2)))
+
+(define-public linux-libre-with-wireguard
+ (package
+ (inherit linux-libre)
+ (name "linux-libre-with-wireguard")
+ (native-inputs
+ `(("wireguard-patch" ,wireguard "kernel-patch")
+ ,@(package-native-inputs linux-libre)))
+ (arguments
+ (substitute-keyword-arguments (package-arguments linux-libre)
+ ((#:phases phases)
+ `(modify-phases ,phases
+ (add-before 'patch-source-shebangs 'add-wireguard
+ (lambda* (#:key inputs #:allow-other-keys)
+ (let* ((wireguard-patch (string-append (assoc-ref inputs "wireguard-patch")
+ "/wireguard.patch")))
+ (invoke "patch" "-p1" "-i" wireguard-patch))))))))))