From 9d9f4b50b446c1c93a861b2bbdb5d64187680abc Mon Sep 17 00:00:00 2001 From: Artturin Date: Fri, 6 Dec 2024 18:58:53 +0200 Subject: [PATCH] Revert "splice.nix: make `pkgs` `splicedPackages`" --- pkgs/development/beam-modules/default.nix | 3 ++- pkgs/development/beam-modules/lib.nix | 5 ++++- pkgs/development/interpreters/perl/default.nix | 6 +++++- pkgs/top-level/all-packages.nix | 10 +++++++--- pkgs/top-level/splice.nix | 2 -- 5 files changed, 18 insertions(+), 8 deletions(-) diff --git a/pkgs/development/beam-modules/default.nix b/pkgs/development/beam-modules/default.nix index b5a4188a0b2a..23649ca76f26 100644 --- a/pkgs/development/beam-modules/default.nix +++ b/pkgs/development/beam-modules/default.nix @@ -1,6 +1,7 @@ -{ lib, pkgs, erlang }: +{ lib, __splicedPackages, erlang }: let + pkgs = __splicedPackages; inherit (lib) makeExtensible; lib' = pkgs.callPackage ./lib.nix { }; diff --git a/pkgs/development/beam-modules/lib.nix b/pkgs/development/beam-modules/lib.nix index 1b021cf93472..2d93b28cda6b 100644 --- a/pkgs/development/beam-modules/lib.nix +++ b/pkgs/development/beam-modules/lib.nix @@ -1,5 +1,8 @@ -{ pkgs, lib }: +{ __splicedPackages, lib }: +let + pkgs = __splicedPackages; +in rec { /* Similar to callPackageWith/callPackage, but without makeOverridable diff --git a/pkgs/development/interpreters/perl/default.nix b/pkgs/development/interpreters/perl/default.nix index 1080f02f6e4d..8fd99172be10 100644 --- a/pkgs/development/interpreters/perl/default.nix +++ b/pkgs/development/interpreters/perl/default.nix @@ -19,7 +19,11 @@ let # - adds spliced package sets to the package set ({ stdenv, pkgs, perl, callPackage, makeScopeWithSplicing' }: let perlPackagesFun = callPackage ../../../top-level/perl-packages.nix { - inherit stdenv pkgs; + # allow 'perlPackages.override { pkgs = pkgs // { imagemagick = imagemagickBig; }; }' like in python3Packages + # most perl packages aren't called with callPackage so it's not possible to override their arguments individually + # the conditional is because the // above won't be applied to __splicedPackages and hopefully no one is doing that when cross-compiling + pkgs = if stdenv.buildPlatform != stdenv.hostPlatform then pkgs.__splicedPackages else pkgs; + inherit stdenv; perl = self; }; diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 9dfde3a30b4a..13db753ede4c 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -5393,7 +5393,9 @@ with pkgs; inherit (darwin.apple_sdk.frameworks) Security; }; - tmuxPlugins = recurseIntoAttrs (callPackage ../misc/tmux-plugins { }); + tmuxPlugins = recurseIntoAttrs (callPackage ../misc/tmux-plugins { + pkgs = pkgs.__splicedPackages; + }); tokei = callPackage ../development/tools/misc/tokei { inherit (darwin.apple_sdk.frameworks) Security; @@ -5754,7 +5756,7 @@ with pkgs; yarn-berry = callPackage ../development/tools/yarn-berry { }; - yarn2nix-moretea = callPackage ../development/tools/yarn2nix-moretea/yarn2nix { }; + yarn2nix-moretea = callPackage ../development/tools/yarn2nix-moretea/yarn2nix { pkgs = pkgs.__splicedPackages; }; inherit (yarn2nix-moretea) yarn2nix @@ -6461,6 +6463,7 @@ with pkgs; idrisPackages = dontRecurseIntoAttrs (callPackage ../development/idris-modules { idris-no-deps = haskellPackages.idris; + pkgs = pkgs.__splicedPackages; }); idris = idrisPackages.with-packages [ idrisPackages.base ] ; @@ -16944,7 +16947,8 @@ with pkgs; openmw-tes3mp = libsForQt5.callPackage ../games/openmw/tes3mp.nix { }; openraPackages_2019 = import ../games/openra_2019 { - inherit lib pkgs; + inherit lib; + pkgs = pkgs.__splicedPackages; }; openra_2019 = openraPackages_2019.engines.release; diff --git a/pkgs/top-level/splice.nix b/pkgs/top-level/splice.nix index e9e1ba02bf81..3b600c22f60e 100644 --- a/pkgs/top-level/splice.nix +++ b/pkgs/top-level/splice.nix @@ -151,8 +151,6 @@ in newScope = extra: lib.callPackageWith (pkgsForCall // extra); - pkgs = if actuallySplice then splicedPackages // { recurseForDerivations = false; } else pkgs; - # prefill 2 fields of the function for convenience makeScopeWithSplicing = lib.makeScopeWithSplicing splicePackages pkgs.newScope; makeScopeWithSplicing' = lib.makeScopeWithSplicing' { inherit splicePackages; inherit (pkgs) newScope; };