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