summaryrefslogtreecommitdiffstats
path: root/pkgs
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs')
-rw-r--r--pkgs/default.nix27
-rw-r--r--pkgs/simple/default.nix15
2 files changed, 24 insertions, 18 deletions
diff --git a/pkgs/default.nix b/pkgs/default.nix
index fb90696..fffd289 100644
--- a/pkgs/default.nix
+++ b/pkgs/default.nix
@@ -13,8 +13,25 @@ in
# Import files and subdirectories like they are overlays.
lib.fix
(builtins.foldl' (lib.flip lib.extends) (_: super)
- (map
- (name: import (./. + "/${name}"))
- (pushBack "override"
- (builtins.attrNames
- (lib.filterAttrs mylib.isNixDirEntry (builtins.readDir ./.))))))
+ (
+ [
+ (self: super: {
+ callObsolescentPackage = 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;
+ })
+ ]
+ ++
+ map
+ (name: import (./. + "/${name}"))
+ (pushBack "override"
+ (builtins.attrNames
+ (lib.filterAttrs mylib.isNixDirEntry (builtins.readDir ./.))))
+ )
+ )
diff --git a/pkgs/simple/default.nix b/pkgs/simple/default.nix
index 1e63017..3dac0aa 100644
--- a/pkgs/simple/default.nix
+++ b/pkgs/simple/default.nix
@@ -1,18 +1,7 @@
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;
+ inherit (super) mylib;
in
- mylib.mapNixDir (path: callPackage path {}) ./.
+mylib.mapNixDir (path: self.callObsolescentPackage path {}) ./.