1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-25 10:41:16 +02:00

Merge pull request #12554 from NixOS/mergify/bp/2.26-maintenance/pr-12553

nix flake archive: Skip relative path inputs (backport #12553)
This commit is contained in:
mergify[bot] 2025-02-24 15:03:38 +00:00 committed by GitHub
commit 31a29e66ea
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 6 additions and 1 deletions

View file

@ -1088,6 +1088,8 @@ 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)

View file

@ -76,6 +76,9 @@ if ! isTestOnNixOS; then
fi
(! grep narHash "$subflake2/flake.lock")
# Test `nix flake archive` with relative path flakes.
nix flake archive --json "$rootFlake"
# Test circular relative path flakes. FIXME: doesn't work at the moment.
if false; then