mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-22 23:13:19 +00:00
e7de14ea98
Older kernels do not support Rust on aarch64, so we have to move the platform check from all-tests.nix into the test itself.
46 lines
1.2 KiB
Nix
46 lines
1.2 KiB
Nix
{ system ? builtins.currentSystem
|
|
, config ? { }
|
|
, pkgs ? import ../.. { inherit system config; }
|
|
}:
|
|
|
|
let
|
|
inherit (pkgs.lib) const filterAttrs mapAttrs meta;
|
|
|
|
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;
|
|
available =
|
|
meta.availableOn pkgs.stdenv.hostPlatform x.rust-out-of-tree-module;
|
|
in success && value && available))
|
|
pkgs.linuxKernel.vanillaPackages;
|
|
in mapAttrs (const kernelRustTest) kernels
|