Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

splice.nix: make pkgs splicedPackages #349316

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions pkgs/development/beam-modules/default.nix
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{ lib, __splicedPackages, erlang }:
{ lib, pkgs, erlang }:

let
pkgs = __splicedPackages;
inherit (lib) makeExtensible;

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

let
pkgs = __splicedPackages;
in
rec {

/* Similar to callPackageWith/callPackage, but without makeOverridable
Expand Down
4 changes: 0 additions & 4 deletions pkgs/development/interpreters/perl/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,6 @@ let
# - adds spliced package sets to the package set
({ stdenv, pkgs, perl, callPackage, makeScopeWithSplicing' }: let
perlPackagesFun = callPackage ../../../top-level/perl-packages.nix {
# 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
32 changes: 14 additions & 18 deletions pkgs/top-level/all-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -1036,14 +1036,14 @@ with pkgs;

fetchpatch = callPackage ../build-support/fetchpatch {
# 0.3.4 would change hashes: https://github.com/NixOS/nixpkgs/issues/25154
patchutils = __splicedPackages.patchutils_0_3_3;
patchutils = pkgs.patchutils_0_3_3;
} // {
tests = pkgs.tests.fetchpatch;
version = 1;
};

fetchpatch2 = callPackage ../build-support/fetchpatch {
patchutils = __splicedPackages.patchutils_0_4_2;
patchutils = pkgs.patchutils_0_4_2;
} // {
tests = pkgs.tests.fetchpatch2;
version = 2;
Expand Down Expand Up @@ -1382,7 +1382,7 @@ with pkgs;

wrapGAppsHook4 = wrapGAppsNoGuiHook.override {
isGraphical = true;
gtk3 = __splicedPackages.gtk4;
gtk3 = pkgs.gtk4;
};

wrapGAppsNoGuiHook = callPackage ../build-support/setup-hooks/wrap-gapps-hook {
Expand Down Expand Up @@ -12820,9 +12820,7 @@ with pkgs;

tmux-xpanes = callPackage ../tools/misc/tmux-xpanes { };

tmuxPlugins = recurseIntoAttrs (callPackage ../misc/tmux-plugins {
pkgs = pkgs.__splicedPackages;
});
tmuxPlugins = recurseIntoAttrs (callPackage ../misc/tmux-plugins { });

tncattach = callPackage ../applications/radio/tncattach { };

Expand Down Expand Up @@ -13879,7 +13877,7 @@ with pkgs;

yarn-berry = callPackage ../development/tools/yarn-berry { };

yarn2nix-moretea = callPackage ../development/tools/yarn2nix-moretea/yarn2nix { pkgs = pkgs.__splicedPackages; };
yarn2nix-moretea = callPackage ../development/tools/yarn2nix-moretea/yarn2nix { };

inherit (yarn2nix-moretea)
yarn2nix
Expand Down Expand Up @@ -14928,7 +14926,6 @@ 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 @@ -18275,7 +18272,7 @@ with pkgs;
shards;

shellcheck = callPackage ../development/tools/shellcheck {
inherit (__splicedPackages.haskellPackages) ShellCheck;
inherit (pkgs.haskellPackages) ShellCheck;
};


Expand Down Expand Up @@ -22553,18 +22550,18 @@ with pkgs;

qt5 = recurseIntoAttrs (makeOverridable
(import ../development/libraries/qt-5/5.15) {
inherit (__splicedPackages)
inherit (pkgs)
makeScopeWithSplicing' generateSplicesForMkScope lib fetchurl fetchpatch fetchgit fetchFromGitHub makeSetupHook makeWrapper
bison cups dconf harfbuzz libGL perl gtk3 python3
llvmPackages_15 overrideSDK overrideLibcxx
darwin;
inherit (__splicedPackages.gst_all_1) gstreamer gst-plugins-base;
inherit (pkgs.gst_all_1) gstreamer gst-plugins-base;
inherit config;
stdenv = if stdenv.hostPlatform.isDarwin then overrideSDK stdenv "11.0" else stdenv;
});

libsForQt5 = (recurseIntoAttrs (import ./qt5-packages.nix {
inherit lib __splicedPackages makeScopeWithSplicing' generateSplicesForMkScope pkgsHostTarget;
inherit lib makeScopeWithSplicing' generateSplicesForMkScope pkgsHostTarget pkgs;
})) // { __recurseIntoDerivationForReleaseJobs = true; };

# plasma5Packages maps to the Qt5 packages set that is used to build the plasma5 desktop
Expand All @@ -22576,7 +22573,7 @@ with pkgs;
qt6 = recurseIntoAttrs (callPackage ../development/libraries/qt-6 { });

qt6Packages = recurseIntoAttrs (import ./qt6-packages.nix {
inherit lib __splicedPackages makeScopeWithSplicing' generateSplicesForMkScope pkgsHostTarget kdePackages;
inherit lib makeScopeWithSplicing' generateSplicesForMkScope pkgsHostTarget pkgs kdePackages;
stdenv = if stdenv.hostPlatform.isDarwin then darwin.apple_sdk_11_0.stdenv else stdenv;
});

Expand Down Expand Up @@ -25198,7 +25195,7 @@ with pkgs;
};

xorg = let
# Use `lib.callPackageWith __splicedPackages` rather than plain `callPackage`
# Use `lib.callPackageWith pkgs` rather than plain `callPackage`
# so as not to have the newly bound xorg items already in scope, which would
# have created a cycle.
overrides = lib.callPackageWith __splicedPackages ../servers/x11/xorg/overrides.nix {
Expand Down Expand Up @@ -31998,11 +31995,11 @@ with pkgs;
};

qutebrowser = callPackage ../applications/networking/browsers/qutebrowser {
inherit (__splicedPackages.qt6Packages) qtbase qtwebengine wrapQtAppsHook qtwayland;
inherit (pkgs.qt6Packages) qtbase qtwebengine wrapQtAppsHook qtwayland;
};

qutebrowser-qt5 = callPackage ../applications/networking/browsers/qutebrowser {
inherit (__splicedPackages.libsForQt5) qtbase qtwebengine wrapQtAppsHook qtwayland;
inherit (pkgs.libsForQt5) qtbase qtwebengine wrapQtAppsHook qtwayland;
};

rakarrack = callPackage ../applications/audio/rakarrack {
Expand Down Expand Up @@ -34809,8 +34806,7 @@ with pkgs;
otto-matic = callPackage ../games/otto-matic { };

openraPackages_2019 = import ../games/openra_2019 {
inherit lib;
pkgs = pkgs.__splicedPackages;
inherit lib pkgs;
};

openra_2019 = openraPackages_2019.engines.release;
Expand Down
5 changes: 2 additions & 3 deletions pkgs/top-level/python-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6956,8 +6956,7 @@ self: super: with self; {
laspy = callPackage ../development/python-modules/laspy { };

laszip = callPackage ../development/python-modules/laszip {
inherit (pkgs) cmake ninja;
inherit (pkgs.__splicedPackages) laszip;
inherit (pkgs) cmake ninja laszip;
};

latex2mathml = callPackage ../development/python-modules/latex2mathml { };
Expand Down Expand Up @@ -10795,7 +10794,7 @@ self: super: with self; {

# Protobuf 5.x
protobuf5 = callPackage ../development/python-modules/protobuf/default.nix {
inherit (pkgs.__splicedPackages) protobuf;
inherit (pkgs) protobuf;
};

# If a protobuf upgrade causes many Python packages to fail, please pin it here to the previous version.
Expand Down
3 changes: 1 addition & 2 deletions pkgs/top-level/qt5-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,13 @@


{ lib
, __splicedPackages
, makeScopeWithSplicing'
, generateSplicesForMkScope
, pkgsHostTarget
, pkgs
}:

let
pkgs = __splicedPackages;
# qt5 set should not be pre-spliced to prevent spliced packages being a part of an unspliced set
# 'pkgsCross.aarch64-multiplatform.pkgsBuildTarget.targetPackages.libsForQt5.qtbase' should not have a `__spliced` but if qt5 is pre-spliced then it will have one.
# pkgsHostTarget == pkgs
Expand Down
3 changes: 1 addition & 2 deletions pkgs/top-level/qt6-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,15 @@
# this file.

{ lib
, __splicedPackages
, makeScopeWithSplicing'
, generateSplicesForMkScope
, stdenv
, pkgsHostTarget
, pkgs
, kdePackages
}:

let
pkgs = __splicedPackages;
# qt6 set should not be pre-spliced to prevent spliced packages being a part of an unspliced set
# 'pkgsCross.aarch64-multiplatform.pkgsBuildTarget.targetPackages.qt6Packages.qtbase' should not have a `__spliced` but if qt6 is pre-spliced then it will have one.
# pkgsHostTarget == pkgs
Expand Down
2 changes: 2 additions & 0 deletions pkgs/top-level/splice.nix
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,8 @@ in

newScope = extra: lib.callPackageWith (pkgsForCall // extra);

pkgs = if actuallySplice then splicedPackages // { recurseForDerivations = false; } else pkgs;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Ericson2314
I wonder why you didn't do this instead of adding __splicedPackages? f27f491


# prefill 2 fields of the function for convenience
makeScopeWithSplicing = lib.makeScopeWithSplicing splicePackages pkgs.newScope;
makeScopeWithSplicing' = lib.makeScopeWithSplicing' { inherit splicePackages; inherit (pkgs) newScope; };
Expand Down