diff --git a/nixos/modules/programs/ccache.nix b/nixos/modules/programs/ccache.nix index 7dad40fcec2c..c758831c759e 100644 --- a/nixos/modules/programs/ccache.nix +++ b/nixos/modules/programs/ccache.nix @@ -38,6 +38,11 @@ in default = "nixbld"; description = "Group owner of CCache directory"; }; + trace = lib.mkOption { + type = lib.types.bool; + default = true; + description = "Trace ccache usage to see which derivations use ccache"; + }; }; config = lib.mkMerge [ @@ -73,7 +78,11 @@ in ( self: super: lib.genAttrs cfg.packageNames ( - pn: super.${pn}.override { stdenv = builtins.trace "with ccache: ${pn}" self.ccacheStdenv; } + pn: + super.${pn}.override { + stdenv = + if cfg.trace then builtins.trace "with ccache: ${pn}" self.ccacheStdenv else self.ccacheStdenv; + } ) )