kernels: set testing to latest if it's newer

Closes https://github.com/NixOS/nixpkgs/pull/130872

authored by Atemu and committed by Alyssa Ross 92029c12 8d0f1c17

+11 -6
+11 -6
pkgs/top-level/linux-kernels.nix
··· 173 173 ]; 174 174 }; 175 175 176 - linux_testing = callPackage ../os-specific/linux/kernel/linux-testing.nix { 177 - kernelPatches = [ 178 - kernelPatches.bridge_stp_helper 179 - kernelPatches.request_key_helper 180 - ]; 181 - }; 176 + linux_testing = let 177 + testing = callPackage ../os-specific/linux/kernel/linux-testing.nix { 178 + kernelPatches = [ 179 + kernelPatches.bridge_stp_helper 180 + kernelPatches.request_key_helper 181 + ]; 182 + }; 183 + latest = packageAliases.linux_latest.kernel; 184 + in if latest.kernelAtLeast testing.baseVersion 185 + then latest 186 + else testing; 182 187 183 188 linux_testing_bcachefs = callPackage ../os-specific/linux/kernel/linux-testing-bcachefs.nix rec { 184 189 kernel = linux_5_15;