1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-11-30 22:20:59 +01:00

Improve subflake handling

Relative 'path:' inputs are now handled correctly in
call-flake.nix. This does require the lock file to record what the
'parent' is relative to which a node's source should be fetched.
This commit is contained in:
Eelco Dolstra 2022-06-30 14:22:35 +02:00
parent 0d14ffbcba
commit 5c2603d9c7
4 changed files with 107 additions and 53 deletions

View file

@ -33,11 +33,16 @@ struct LockedNode : Node
FlakeRef lockedRef, originalRef;
bool isFlake = true;
/* The node relative to which relative source paths
(e.g. 'path:../foo') are interpreted. */
std::optional<InputPath> parentPath;
LockedNode(
const FlakeRef & lockedRef,
const FlakeRef & originalRef,
bool isFlake = true)
: lockedRef(lockedRef), originalRef(originalRef), isFlake(isFlake)
bool isFlake = true,
std::optional<InputPath> parentPath = {})
: lockedRef(lockedRef), originalRef(originalRef), isFlake(isFlake), parentPath(parentPath)
{ }
LockedNode(const nlohmann::json & json);