summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/default.nix2
-rw-r--r--lib/trivial.nix9
2 files changed, 10 insertions, 1 deletions
diff --git a/lib/default.nix b/lib/default.nix
index 4d0035945aaa..aff1df150f13 100644
--- a/lib/default.nix
+++ b/lib/default.nix
@@ -73,7 +73,7 @@ let
inherit (self.trivial) id const pipe concat or and xor bitAnd bitOr bitXor
bitNot boolToString mergeAttrs flip mapNullable inNixShell isFloat min max
importJSON importTOML warn warnIf warnIfNot throwIf throwIfNot checkListOfEnum
- info showWarnings nixpkgsVersion version isInOldestRelease
+ info showWarnings nixpkgsVersion version isInOldestRelease oldestSupportedReleaseIsAtLeast
mod compare splitByAndCompare seq deepSeq lessThan add sub
functionArgs setFunctionArgs isFunction toFunction mirrorFunctionArgs
fromHexString toHexString toBaseDigits inPureEvalMode isBool isInt pathExists
diff --git a/lib/trivial.nix b/lib/trivial.nix
index f0afbf609fca..205224126094 100644
--- a/lib/trivial.nix
+++ b/lib/trivial.nix
@@ -397,6 +397,15 @@ in {
Set it to the upcoming release, matching the nixpkgs/.version file.
*/
isInOldestRelease =
+ lib.warnIf (lib.oldestSupportedReleaseIsAtLeast 2411)
+ "lib.isInOldestRelease is deprecated. Use lib.oldestSupportedReleaseIsAtLeast instead."
+ lib.oldestSupportedReleaseIsAtLeast;
+
+ /**
+ Alias for `isInOldestRelease` introduced in 24.11.
+ Use `isInOldestRelease` in expressions outside of Nixpkgs for greater compatibility.
+ */
+ oldestSupportedReleaseIsAtLeast =
release:
release <= lib.trivial.oldestSupportedRelease;