Skip to content

Commit

Permalink
Revert "splice.nix: make pkgs splicedPackages" (NixOS#362496)
Browse files Browse the repository at this point in the history
  • Loading branch information
Artturin authored Dec 6, 2024
2 parents 2463134 + 9d9f4b5 commit 6b2892c
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 8 deletions.
3 changes: 2 additions & 1 deletion pkgs/development/beam-modules/default.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{ lib, pkgs, erlang }:
{ lib, __splicedPackages, erlang }:

let
pkgs = __splicedPackages;
inherit (lib) makeExtensible;

lib' = pkgs.callPackage ./lib.nix { };
Expand Down
5 changes: 4 additions & 1 deletion pkgs/development/beam-modules/lib.nix
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
{ pkgs, lib }:
{ __splicedPackages, lib }:

let
pkgs = __splicedPackages;
in
rec {

/* Similar to callPackageWith/callPackage, but without makeOverridable
Expand Down
6 changes: 5 additions & 1 deletion pkgs/development/interpreters/perl/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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;
};

Expand Down
10 changes: 7 additions & 3 deletions pkgs/top-level/all-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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 ] ;
Expand Down Expand Up @@ -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;
Expand Down
2 changes: 0 additions & 2 deletions pkgs/top-level/splice.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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; };
Expand Down

0 comments on commit 6b2892c

Please sign in to comment.