From 3c1f82f99ee02dad4eb480f6216ae2ece445d11d Mon Sep 17 00:00:00 2001 From: Artturin Date: Mon, 14 Aug 2023 01:42:25 +0300 Subject: lib.customisation.makeScope: Make `overrideScope` consistent with `makeScopeWithSplicing` Right now converting `makeScope` to `makeScopeWithSplicing` is not transparent to users and requires adding a warning for `overrideScope'` in the set itself. Warning and `overrideScope'` were added in 2018 b9dce11712d2bfc8cd367df5a7f737a5cec1e252 and there should be no users left after 5 years. --- lib/customisation.nix | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'lib/customisation.nix') diff --git a/lib/customisation.nix b/lib/customisation.nix index a9281b1ab69..e1332007602 100644 --- a/lib/customisation.nix +++ b/lib/customisation.nix @@ -269,10 +269,11 @@ rec { let self = f self // { newScope = scope: newScope (self // scope); callPackage = self.newScope {}; - overrideScope = g: lib.warn - "`overrideScope` (from `lib.makeScope`) is deprecated. Do `overrideScope' (self: super: { … })` instead of `overrideScope (super: self: { … })`. All other overrides have the parameters in that order, including other definitions of `overrideScope`. This was the only definition violating the pattern." - (makeScope newScope (lib.fixedPoints.extends (lib.flip g) f)); - overrideScope' = g: makeScope newScope (lib.fixedPoints.extends g f); + overrideScope = g: makeScope newScope (lib.fixedPoints.extends g f); + # Remove after 24.11 is released. + overrideScope' = g: lib.warnIf (lib.isInOldestRelease 2311) + "`overrideScope'` (from `lib.makeScope`) has been renamed to `overrideScope`." + (makeScope newScope (lib.fixedPoints.extends g f)); packages = f; }; in self; -- cgit 1.4.1