1{
2 system ? builtins.currentSystem,
3 config ? { },
4 pkgs ? import ../.. { inherit system config; },
5}:
6
7let
8 inherit (pkgs.lib)
9 const
10 filterAttrs
11 mapAttrs
12 meta
13 ;
14
15 kernelRustTest =
16 kernelPackages:
17 import ./make-test-python.nix (
18 { lib, ... }:
19 {
20 name = "kernel-rust";
21 meta.maintainers = with lib.maintainers; [
22 blitz
23 ma27
24 ];
25 nodes.machine =
26 { config, ... }:
27 {
28 boot = {
29 inherit kernelPackages;
30 extraModulePackages = [ config.boot.kernelPackages.rust-out-of-tree-module ];
31 kernelPatches = [
32 {
33 name = "Rust Support";
34 patch = null;
35 features = {
36 rust = true;
37 };
38 }
39 ];
40 };
41 };
42 testScript = ''
43 machine.wait_for_unit("default.target")
44 machine.succeed("modprobe rust_out_of_tree")
45 '';
46 }
47 );
48
49 kernels = {
50 inherit (pkgs.linuxKernel.packages) linux_testing;
51 }
52 // filterAttrs (const (
53 x:
54 let
55 inherit (builtins.tryEval (x.rust-out-of-tree-module or null != null))
56 success
57 value
58 ;
59 available = meta.availableOn pkgs.stdenv.hostPlatform x.rust-out-of-tree-module;
60 in
61 success && value && available
62 )) pkgs.linuxKernel.vanillaPackages;
63in
64mapAttrs (const kernelRustTest) kernels