nixpkgs/nixos/tests/kernel-generic.nix
Maximilian Bosch 91f7851fb2
linux_hardened: only provide latest LTS and lattest stable version
As proposed in #346018 (not closing the ticket, this affects other
variants as well).

The packaging for hardened is in a pretty sad state: it was lagging
several patch-releases behind and nobody seems to care. The update
script aged poorly: the automatic removal was flat-out broken, several
type annotations are plain wrong (`list[int] != packaging.Version`).

This patch is an attempt to reduce the scope for the maintainer team
drastically to provide _some_ maintenance again by only packaging latest
LTS and latest stable.

Also, remove the top-level attributes for this. I still don't see any
compelling reason to give hardly used flavours that special treatment.
2025-08-23 17:42:48 +02:00

63 lines
1.4 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_6_12_hardened
linux_6_15_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);
};
}