@@ -11,11 +11,10 @@ let
1111 });
1212in rec {
1313 toStorePath = target:
14− # If a store path has been given, transform it to a string. And make sure
15− # to capture the store path in its context.
16− if lib.isStorePath target then
17− let path = toString target; in
18− builtins.appendContext path { "${path}" = { path = true; }; }
14+ # If a store path has been given but is a string, add the missing context
15+ # to it so it will be propagated properly as a build input.
16+ if builtins.isString target && lib.isStorePath target then
17+ builtins.appendContext target { "${target}" = { path = true; }; }
1918 # Otherwise, add to the store. This takes care of appending the store path
2019 # in the context automatically.
2120 else "${target}";