2024-01-28 19:36:51 +00:00
|
|
|
{ system ? builtins.currentSystem
|
|
|
|
, config ? { }
|
|
|
|
, pkgs ? import ../.. { inherit system config; }
|
|
|
|
}:
|
2023-11-30 16:00:39 +00:00
|
|
|
|
2024-01-28 19:36:51 +00:00
|
|
|
let
|
2024-03-27 15:15:37 +00:00
|
|
|
inherit (pkgs.lib) const filterAttrs mapAttrs meta;
|
2023-11-30 16:00:39 +00:00
|
|
|
|
2024-01-28 19:36:51 +00:00
|
|
|
kernelRustTest = kernelPackages: import ./make-test-python.nix ({ lib, ... }: {
|
|
|
|
name = "kernel-rust";
|
|
|
|
meta.maintainers = with lib.maintainers; [ blitz ma27 ];
|
|
|
|
nodes.machine = { config, ... }: {
|
|
|
|
boot = {
|
|
|
|
inherit kernelPackages;
|
|
|
|
extraModulePackages = [ config.boot.kernelPackages.rust-out-of-tree-module ];
|
|
|
|
kernelPatches = [
|
|
|
|
{
|
|
|
|
name = "Rust Support";
|
|
|
|
patch = null;
|
|
|
|
features = {
|
|
|
|
rust = true;
|
|
|
|
};
|
|
|
|
}
|
|
|
|
];
|
|
|
|
};
|
2023-11-30 16:00:39 +00:00
|
|
|
};
|
2024-01-28 19:36:51 +00:00
|
|
|
testScript = ''
|
|
|
|
machine.wait_for_unit("default.target")
|
|
|
|
machine.succeed("modprobe rust_out_of_tree")
|
|
|
|
'';
|
|
|
|
});
|
2023-11-30 16:00:39 +00:00
|
|
|
|
2024-01-28 19:36:51 +00:00
|
|
|
kernels = {
|
|
|
|
inherit (pkgs.linuxKernel.packages) linux_testing;
|
|
|
|
}
|
|
|
|
// filterAttrs
|
|
|
|
(const (x: let
|
|
|
|
inherit (builtins.tryEval (
|
|
|
|
x.rust-out-of-tree-module or null != null
|
|
|
|
)) success value;
|
2024-03-27 15:15:37 +00:00
|
|
|
available =
|
|
|
|
meta.availableOn pkgs.stdenv.hostPlatform x.rust-out-of-tree-module;
|
|
|
|
in success && value && available))
|
2024-01-28 19:36:51 +00:00
|
|
|
pkgs.linuxKernel.vanillaPackages;
|
|
|
|
in mapAttrs (const kernelRustTest) kernels
|