[Overlays] Add option to trace callPackage

This commit is contained in:
Antoine Viallon 2022-10-08 20:44:04 +02:00
parent d25edca6c4
commit 52407e3f4e
Signed by: aviallon
GPG key ID: 186FC35EDEB25716

View file

@ -26,6 +26,7 @@ in
description = "Wether to enable CPU-specific optimizations for some packages or not"; description = "Wether to enable CPU-specific optimizations for some packages or not";
type = types.bool; type = types.bool;
}; };
traceCallPackage = mkEnableOption "printing package names each time callPackage is evaluated";
}; };
config = mkIf cfg.enable { config = mkIf cfg.enable {
nix.nixPath = nix.nixPath =
@ -36,12 +37,20 @@ in
; ;
nixpkgs.overlays = [ nixpkgs.overlays = []
(self: super: { ++ [(self: super: {
inherit unstable; inherit unstable;
inherit nur; inherit nur;
}) })]
(self: super: { ++ optional cfg.traceCallPackage [(self: super: {
callPackage = path: overrides:
let
_pkg = super.callPackage path overrides;
_name = _pkg.name or _pkg.pname or "<unknown>";
in trace "callPackage ${_name}" _pkg
;
})]
++ [(self: super: {
htop = super.htop.overrideAttrs (old: { htop = super.htop.overrideAttrs (old: {
configureFlags = old.configureFlags ++ [ configureFlags = old.configureFlags ++ [
"--enable-hwloc" "--enable-hwloc"