diff options
Diffstat (limited to 'nix/readTree/default.nix')
-rw-r--r-- | nix/readTree/default.nix | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/nix/readTree/default.nix b/nix/readTree/default.nix index 22815a44c4ee..5d2e1fff6aa8 100644 --- a/nix/readTree/default.nix +++ b/nix/readTree/default.nix @@ -58,6 +58,13 @@ let __readTreeChildren = builtins.attrNames children; }; + # Create a label from a target's tree location. + mkLabel = target: + let label = concatStringsSep "/" target.__readTree; + in if target ? __subtarget + then "${label}:${target.__subtarget}" + else label; + # Merge two attribute sets, but place attributes in `passthru` via # `overrideAttrs` for derivation targets that support it. merge = a: b: @@ -188,7 +195,7 @@ let isDerivation = x: isAttrs x && x ? type && x.type == "derivation"; in { - inherit gather; + inherit gather mkLabel; __functor = _: { path |