override-utils: minor refactor
This commit is contained in:
parent
f870fb9785
commit
aa60d9a6aa
1 changed files with 2 additions and 2 deletions
|
@ -3,7 +3,7 @@
|
|||
let
|
||||
inherit (builtins) attrNames elemAt functionArgs isAttrs isPath length mapAttrs match pathExists removeAttrs toJSON tryEval;
|
||||
inherit (stable) callPackage fetchFromGitHub;
|
||||
inherit (stable.lib) attrByPath const findFirst getAttrFromPath hasAttrByPath info optionalAttrs optionalString showAttrPath throwIf versionAtLeast;
|
||||
inherit (stable.lib) const findFirst getAttrFromPath hasAttrByPath info optionalAttrs optionalString showAttrPath throwIf versionAtLeast;
|
||||
|
||||
# Utilities
|
||||
composeOverrides = f1: f2: a0: let o1 = f1 a0; o2 = f2 (a0 // o1); in o1 // o2;
|
||||
|
@ -91,7 +91,7 @@ let
|
|||
unnecessary = isStable repo && !doOverlay && !doOverride;
|
||||
unnecessarySearch = search != null && repo.lib.trivial.version != search.lib.trivial.version;
|
||||
in
|
||||
if (attrByPath path { } stable) ? "overrideScope'" then
|
||||
if hasAttrByPath (path ++ [ "overrideScope'" ]) stable then
|
||||
(getAttrFromPath path stable).overrideScope' (_: _: mapAttrs (resolve path) spec)
|
||||
else
|
||||
throwIf unnecessarySearch "${name} no longer requires an extra search repository"
|
||||
|
|
Loading…
Reference in a new issue