summaryrefslogtreecommitdiffstats
path: root/pkgs/simple/default.nix
blob: 1e63017a0a876c8cec4e466f172067bc7467ba1d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
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 {}) ./.