summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Hensing <robert@roberthensing.nl>2024-10-08 11:02:09 +0200
committerRobert Hensing <robert@roberthensing.nl>2024-10-08 11:04:29 +0200
commitc2b411e67475b42f7130a202183b90801f9874b6 (patch)
treef4c703c0c6b42586d58576e0f413b1d0129163da
parentmacos-builder: readd Nix CLI for debugging (#347205) (diff)
downloadnixpkgs-c2b411e67475b42f7130a202183b90801f9874b6.tar.gz
lib.oldestSupportedReleaseIsAtLeast: rename from bad name and deprecate after 24.11
It seems impossible to describe this condition more concisely without making it incomprehensible.
-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;