be5f4833fe
New overlay code in inspired by <nixpkgs/pkgs/top-level/stage.nix>.
17 lines
584 B
Nix
17 lines
584 B
Nix
self: super:
|
|
|
|
let
|
|
# This callPackage will try to detect obsolete overrides.
|
|
lib = super.stockholm.lib;
|
|
callPackage = path: args: let
|
|
override = self.callPackage path args;
|
|
upstream = lib.optionalAttrs (override ? "name")
|
|
(super.${(lib.parseDrvName override.name).name} or {});
|
|
in if upstream ? "name" &&
|
|
override ? "name" &&
|
|
lib.compareVersions upstream.name override.name != -1
|
|
then lib.trace "Upstream `${upstream.name}' gets overridden by `${override.name}'." override
|
|
else override;
|
|
in
|
|
lib.mapNixDir (path: callPackage path {}) ./.
|