mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-27 09:23:01 +00:00
37ac24e2c7
In #283893 we realized that not only 6.7, but also testing is affected. And with more stable kernels following, we'll probably want to test against all of them whether Rust support is working fine. As long as it's not the default at least, then we should probably move this to `kernel-generic`. Every kernel that's new enough to support `rust-out-of-tree-module` (and `linux_testing`) is part of this text matrix.
44 lines
1.1 KiB
Nix
44 lines
1.1 KiB
Nix
{ system ? builtins.currentSystem
|
|
, config ? { }
|
|
, pkgs ? import ../.. { inherit system config; }
|
|
}:
|
|
|
|
let
|
|
inherit (pkgs.lib) const filterAttrs mapAttrs;
|
|
|
|
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;
|
|
};
|
|
}
|
|
];
|
|
};
|
|
};
|
|
testScript = ''
|
|
machine.wait_for_unit("default.target")
|
|
machine.succeed("modprobe rust_out_of_tree")
|
|
'';
|
|
});
|
|
|
|
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;
|
|
in success && value))
|
|
pkgs.linuxKernel.vanillaPackages;
|
|
in mapAttrs (const kernelRustTest) kernels
|