1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-11-14 22:42:41 +01:00

nix flake archive: Skip relative path inputs

Fixes #12438.

(cherry picked from commit b4dfeafed5)
This commit is contained in:
Eelco Dolstra 2025-02-24 15:30:30 +01:00 committed by Mergify
parent 6d3ee99463
commit d670380bd9
2 changed files with 6 additions and 1 deletions

View file

@ -1088,12 +1088,14 @@ struct CmdFlakeArchive : FlakeCommand, MixJSON, MixDryRun
nlohmann::json jsonObj2 = json ? json::object() : nlohmann::json(nullptr);
for (auto & [inputName, input] : node.inputs) {
if (auto inputNode = std::get_if<0>(&input)) {
if ((*inputNode)->lockedRef.input.isRelative())
continue;
auto storePath =
dryRun
? (*inputNode)->lockedRef.input.computeStorePath(*store)
: (*inputNode)->lockedRef.input.fetchToStore(store).first;
if (json) {
auto& jsonObj3 = jsonObj2[inputName];
auto & jsonObj3 = jsonObj2[inputName];
jsonObj3["path"] = store->printStorePath(storePath);
sources.insert(std::move(storePath));
jsonObj3["inputs"] = traverse(**inputNode);