remove findKernel

This commit is contained in:
Shelvacu
2025-05-02 14:19:46 -07:00
committed by Shelvacu on fw
parent 2f946bdab1
commit 61af04b57e
2 changed files with 0 additions and 48 deletions

View File

@@ -6,5 +6,4 @@ self: _super: {
openterface-qt = self.callPackage ../packages/openterface-qt.nix { };
transferwee = self.callPackage ../packages/transferwee.nix { };
z3 = self.callPackage ../packages/z3 { };
findKernel = self.callPackage ../packages/findKernel.nix { };
}

View File

@@ -1,47 +0,0 @@
{
lib,
linuxKernel,
}:
{
version ? null,
hardened ? false,
libre ? false,
zen ? false,
lts ? false,
}:
let
# https://www.kernel.org/category/releases.html
ltsBranches = [
"5.4"
"5.10"
"5.15"
"6.1"
"6.6"
"6.12"
];
removePatch = vers:
let
components = builtins.splitVersion vers;
withoutPatch = lib.sublist 0 2 components;
in
lib.throwIf ((builtins.length components) < 2) "not a specific enough version"
lib.concatStringsSep "." withoutPatch;
isLts = version:
builtins.elem (removePatch version) ltsBranches;
results = lib.pipe linuxKernel.packages [
builtins.attrValues
(builtins.filter (kPkgs:
(builtins.tryEval kPkgs).success
&& kPkgs ? kernel
&& (version == null || (removePatch kPkgs.kernel.version) == (removePatch version))
&& (!lts || isLts kPkgs.kernel.version)
&& kPkgs.kernel.isHardened == hardened
&& kPkgs.kernel.isLibre == libre
&& kPkgs.kernel.isZen == zen
))
(builtins.sort (a: b: (lib.versionOlder a.kernel.version b.kernel.version)))
];
in
lib.throwIf (lts && version != null && !isLts version) "Selected lts = true and version = ${version}, but ${version} is not an LTS version"
lib.throwIf ((builtins.length results) == 0) "Could not find kernel matching parameters"
lib.last results