summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2024-04-20 19:07:35 +0200
committertv <tv@krebsco.de>2024-04-21 00:38:34 +0200
commit604a41bb3b670dca72ea57068575c47032ce0dc1 (patch)
treee2d31ca996b4b87820e97cff6efc3a7799ad7061
parent05aafd5140187af7157b2c02629f061f3e7404a8 (diff)
callObsolescentPackage: init from local definition
-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 {}) ./.