From 185153fbb695b60f95972f2823d6c17d28f74fee Mon Sep 17 00:00:00 2001 From: Adam Joseph Date: Mon, 23 Oct 2023 23:58:29 -0700 Subject: [PATCH] top-level/splice.nix: add NIXPKGS_ALWAYS_SPLICE debugging aid --- pkgs/top-level/splice.nix | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/pkgs/top-level/splice.nix b/pkgs/top-level/splice.nix index 9ac0fe2200f92..6780600c10b40 100644 --- a/pkgs/top-level/splice.nix +++ b/pkgs/top-level/splice.nix @@ -14,6 +14,15 @@ # For performance reasons, rather than uniformally splice in all cases, we only # do so when `pkgs` and `buildPackages` are distinct. The `actuallySplice` # parameter there the boolean value of that equality check. + +let + # This is for debugging only. It significantly degrades + # performance. In theory it is impure, but in practice it should + # not affect the result of eval unless you're going out of your + # way to detect that it has been set (i.e. myDrv?__spliced). + NIXPKGS_ALWAYS_SPLICE = builtins.getEnv("NIXPKGS_ALWAYS_SPLICE") != ""; +in + lib: pkgs: actuallySplice: let @@ -102,7 +111,9 @@ let , pkgsHostTarget , pkgsTargetTarget } @ args: - if actuallySplice then spliceReal args else pkgsHostTarget; + if !NIXPKGS_ALWAYS_SPLICE && actuallySplice + then pkgsHostTarget + else spliceReal args; splicedPackages = splicePackages {