self: super: let inherit (super) lib mylib; # This callPackage will try to detect obsolete overrides. callPackage = path: args: let override = self.callPackage path args; upstream = lib.optionalAttrs (override ? "name") (super.${(builtins.parseDrvName override.name).name} or {}); in if upstream ? "name" && override ? "name" && builtins.compareVersions upstream.name override.name != -1 then builtins.trace "Upstream `${upstream.name}' gets overridden by `${override.name}'." override else override; in mylib.mapNixDir (path: callPackage path {}) ./.