mirror of
https://github.com/ilyakooo0/nix-bundle.git
synced 2024-09-11 06:55:53 +03:00
Merge pull request #79 from aloiscochard/feature/fix-path
Properly differentiate between derivation and store path.
This commit is contained in:
commit
223f4ffc41
@ -11,10 +11,11 @@ let
|
||||
});
|
||||
in rec {
|
||||
toStorePath = target:
|
||||
# If a store path has been given but is a string, add the missing context
|
||||
# If a store path has been given but is not a derivation, add the missing context
|
||||
# to it so it will be propagated properly as a build input.
|
||||
if builtins.isString target && lib.isStorePath target then
|
||||
builtins.appendContext target { "${target}" = { path = true; }; }
|
||||
if !(lib.isDerivation target) && lib.isStorePath target then
|
||||
let path = toString target; in
|
||||
builtins.appendContext path { "${path}" = { path = true; }; }
|
||||
# Otherwise, add to the store. This takes care of appending the store path
|
||||
# in the context automatically.
|
||||
else "${target}";
|
||||
|
Loading…
Reference in New Issue
Block a user