2024-06-16 13:16:48 +00:00
|
|
|
{ lib, fetchFromGitHub, kernel, unstableGitUpdater }:
|
2023-11-27 13:28:37 +00:00
|
|
|
kernel.stdenv.mkDerivation {
|
2024-06-16 13:16:48 +00:00
|
|
|
pname = "rust-out-of-tree-module";
|
2024-06-16 13:17:44 +00:00
|
|
|
version = "0-unstable-2024-05-06";
|
2023-11-27 13:28:37 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "Rust-for-linux";
|
|
|
|
repo = "rust-out-of-tree-module";
|
|
|
|
|
2024-06-16 13:17:44 +00:00
|
|
|
rev = "9872947486bb8f60b0d11db15d546a3d06156ec5";
|
|
|
|
hash = "sha256-TzCySY7uQac98dU+Nu5dC4Usm7oG0iIdZZmZgAOpni4=";
|
2023-11-27 13:28:37 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = kernel.moduleBuildDependencies;
|
|
|
|
makeFlags = kernel.makeFlags ++ [ "KDIR=${kernel.dev}/lib/modules/${kernel.modDirVersion}/build" ];
|
|
|
|
|
|
|
|
installFlags = [ "INSTALL_MOD_PATH=${placeholder "out"}" ];
|
|
|
|
installTargets = [ "modules_install" ];
|
|
|
|
|
2024-06-16 13:16:48 +00:00
|
|
|
passthru.updateScript = unstableGitUpdater { };
|
|
|
|
|
2023-11-27 13:28:37 +00:00
|
|
|
meta = {
|
|
|
|
broken = !kernel.withRust;
|
|
|
|
description = "Basic template for an out-of-tree Linux kernel module written in Rust";
|
|
|
|
homepage = "https://github.com/Rust-for-Linux/rust-out-of-tree-module";
|
|
|
|
license = lib.licenses.gpl2Only;
|
|
|
|
maintainers = [ lib.maintainers.blitz ];
|
2024-03-27 15:15:05 +00:00
|
|
|
platforms = [ "x86_64-linux" ]
|
|
|
|
++ lib.optional (kernel.kernelAtLeast "6.9") "aarch64-linux";
|
2023-11-27 13:28:37 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|