stockholm/krebs/5pkgs/simple/default.nix
tv be5f4833fe pkgs: import relative stockholm lib only once
New overlay code in inspired by <nixpkgs/pkgs/top-level/stage.nix>.
2021-10-12 22:11:08 +02:00

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 {}) ./.