@@ -11,10 +11,11 @@ let
13 toStorePath = target:
13 toStorePath = target:
14− # If a store path has been given but is a string, add the missing context
14+ # If a store path has been given but is not a derivation, add the missing context
15 # to it so it will be propagated properly as a build input.
15 # to it so it will be propagated properly as a build input.
16− if builtins.isString target && lib.isStorePath target then
16+ if !(lib.isDerivation target) && lib.isStorePath target then
17+ let path = toString target; in
17− builtins.appendContext target { "${target}" = { path = true; }; }
18+ builtins.appendContext path { "${path}" = { path = true; }; }
18 # Otherwise, add to the store. This takes care of appending the store path
19 # Otherwise, add to the store. This takes care of appending the store path
19 # in the context automatically.
20 # in the context automatically.
20 else "${target}";
21 else "${target}";