mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-26 00:43:20 +00:00
rust-out-of-tree-module: init
Adding this as an example and test whether the Rust support in the Linux kernel works.
This commit is contained in:
parent
8a5f6594da
commit
5fca7feab9
28
pkgs/os-specific/linux/rust-out-of-tree-module/default.nix
Normal file
28
pkgs/os-specific/linux/rust-out-of-tree-module/default.nix
Normal file
@ -0,0 +1,28 @@
|
||||
{ lib, fetchFromGitHub, kernel }:
|
||||
kernel.stdenv.mkDerivation {
|
||||
name = "rust-out-of-tree-module";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "Rust-for-linux";
|
||||
repo = "rust-out-of-tree-module";
|
||||
|
||||
rev = "7addf9dafba795524f6179a557f7272ecbe1b165";
|
||||
hash = "sha256-Bj7WonZ499W/FajbxjM7yBkU9iTxTW7CrRbCSzWbsSc=";
|
||||
};
|
||||
|
||||
nativeBuildInputs = kernel.moduleBuildDependencies;
|
||||
makeFlags = kernel.makeFlags ++ [ "KDIR=${kernel.dev}/lib/modules/${kernel.modDirVersion}/build" ];
|
||||
|
||||
installFlags = [ "INSTALL_MOD_PATH=${placeholder "out"}" ];
|
||||
installTargets = [ "modules_install" ];
|
||||
|
||||
meta = {
|
||||
broken = !kernel.withRust;
|
||||
description = "A 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 ];
|
||||
platforms = lib.platforms.linux;
|
||||
};
|
||||
|
||||
}
|
@ -458,6 +458,8 @@ in {
|
||||
|
||||
facetimehd = callPackage ../os-specific/linux/facetimehd { };
|
||||
|
||||
rust-out-of-tree-module = if lib.versionAtLeast kernel.version "6.7" then callPackage ../os-specific/linux/rust-out-of-tree-module { } else null;
|
||||
|
||||
tuxedo-keyboard = if lib.versionAtLeast kernel.version "4.14" then callPackage ../os-specific/linux/tuxedo-keyboard { } else null;
|
||||
|
||||
jool = callPackage ../os-specific/linux/jool { };
|
||||
|
Loading…
Reference in New Issue
Block a user