forked from mirrors/nixpkgs
lib.compose{Many,}Extensions: Make compatible with nix flake check
This commit is contained in:
parent
bc52ddab2d
commit
d09222e48f
|
@ -72,10 +72,10 @@ rec {
|
||||||
# into one where changes made in the first are available in the
|
# into one where changes made in the first are available in the
|
||||||
# 'super' of the second
|
# 'super' of the second
|
||||||
composeExtensions =
|
composeExtensions =
|
||||||
f: g: self: super:
|
f: g: final: prev:
|
||||||
let fApplied = f self super;
|
let fApplied = f final prev;
|
||||||
super' = super // fApplied;
|
prev' = prev // fApplied;
|
||||||
in fApplied // g self super';
|
in fApplied // g final prev';
|
||||||
|
|
||||||
# Compose several extending functions of the type expected by 'extends' into
|
# Compose several extending functions of the type expected by 'extends' into
|
||||||
# one where changes made in preceding functions are made available to
|
# one where changes made in preceding functions are made available to
|
||||||
|
@ -84,7 +84,7 @@ rec {
|
||||||
# composeManyExtensions : [packageSet -> packageSet -> packageSet] -> packageSet -> packageSet -> packageSet
|
# composeManyExtensions : [packageSet -> packageSet -> packageSet] -> packageSet -> packageSet -> packageSet
|
||||||
# ^final ^prev ^overrides ^final ^prev ^overrides
|
# ^final ^prev ^overrides ^final ^prev ^overrides
|
||||||
composeManyExtensions =
|
composeManyExtensions =
|
||||||
lib.foldr (x: y: composeExtensions x y) (self: super: {});
|
lib.foldr (x: y: composeExtensions x y) (final: prev: {});
|
||||||
|
|
||||||
# Create an overridable, recursive attribute set. For example:
|
# Create an overridable, recursive attribute set. For example:
|
||||||
#
|
#
|
||||||
|
|
Loading…
Reference in a new issue