nixpkgs/nixos/tests/kernel-generic.nix
Silvan Mosberger 4f0dadbf38 treewide: format all inactive Nix files
After final improvements to the official formatter implementation,
this commit now performs the first treewide reformat of Nix files using it.
This is part of the implementation of RFC 166.

Only "inactive" files are reformatted, meaning only files that
aren't being touched by any PR with activity in the past 2 months.
This is to avoid conflicts for PRs that might soon be merged.
Later we can do a full treewide reformat to get the rest,
which should not cause as many conflicts.

A CI check has already been running for some time to ensure that new and
already-formatted files are formatted, so the files being reformatted here
should also stay formatted.

This commit was automatically created and can be verified using

    nix-build a08b3a4d19.tar.gz \
      --argstr baseRev b32a094368
    result/bin/apply-formatting $NIXPKGS_PATH
2024-12-10 20:26:33 +01:00

67 lines
1.5 KiB
Nix

{
system ? builtins.currentSystem,
config ? { },
pkgs ? import ../.. { inherit system config; },
}@args:
with pkgs.lib;
let
testsForLinuxPackages =
linuxPackages:
(import ./make-test-python.nix (
{ pkgs, ... }:
{
name = "kernel-${linuxPackages.kernel.version}";
meta = with pkgs.lib.maintainers; {
maintainers = [
nequissimus
atemu
ma27
];
};
nodes.machine =
{ ... }:
{
boot.kernelPackages = linuxPackages;
};
testScript = ''
assert "Linux" in machine.succeed("uname -s")
assert "${linuxPackages.kernel.modDirVersion}" in machine.succeed("uname -a")
'';
}
) args);
kernels = pkgs.linuxKernel.vanillaPackages // {
inherit (pkgs.linuxKernel.packages)
linux_5_4_hardened
linux_5_10_hardened
linux_5_15_hardened
linux_6_1_hardened
linux_6_6_hardened
linux_6_11_hardened
linux_rt_5_4
linux_rt_5_10
linux_rt_5_15
linux_rt_6_1
linux_rt_6_6
linux_libre
linux_testing
;
};
in
mapAttrs (_: lP: testsForLinuxPackages lP) kernels
// {
passthru = {
inherit testsForLinuxPackages;
# Useful for development testing of all Kernel configs without building full Kernel
configfiles = mapAttrs (_: lP: lP.kernel.configfile) kernels;
testsForKernel = kernel: testsForLinuxPackages (pkgs.linuxPackagesFor kernel);
};
}