Add some functions to allow for a major.minor kernel version to be able to auto-allow the major.minor.patch to be auto-selected
This commit is contained in:
parent
606b6a270e
commit
c5214dc06a
|
@ -6,7 +6,9 @@
|
||||||
}:
|
}:
|
||||||
|
|
||||||
let
|
let
|
||||||
inherit (lib) recurseIntoAttrs versions;
|
inherit (builtins) elem;
|
||||||
|
inherit (lib) recurseIntoAttrs types versions;
|
||||||
|
|
||||||
repos = pkgs.callPackage ../repos.nix {};
|
repos = pkgs.callPackage ../repos.nix {};
|
||||||
|
|
||||||
linuxPackage =
|
linuxPackage =
|
||||||
|
@ -36,6 +38,18 @@ let
|
||||||
inherit version patchSrc;
|
inherit version patchSrc;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
versionsOf = version:
|
||||||
|
# Provides a list of versions that can be used as an enum option for this full version:
|
||||||
|
[ version (versions.majorMinor version) ];
|
||||||
|
|
||||||
|
versionsOfOption = version:
|
||||||
|
# Provide an enum option for versions of this kernel:
|
||||||
|
types.enum (versionsOf version);
|
||||||
|
|
||||||
|
isVersionOf = kernelVersion: version:
|
||||||
|
# Test if the provided version is considered one of the list of versions from above:
|
||||||
|
elem version (versionsOf version);
|
||||||
|
|
||||||
in {
|
in {
|
||||||
inherit linuxPackage repos surfacePatches;
|
inherit linuxPackage repos surfacePatches versionsOf isVersionOf versionsOfOption;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue