nixos-rebuild-ng: add missing copy_flags for nix copy

This commit is contained in:
Thiago Kenji Okada
2024-12-27 18:03:02 +00:00
parent 255c9b0627
commit 58e948dccc
2 changed files with 5 additions and 3 deletions
@@ -192,6 +192,7 @@ def copy_closure(
[
"nix",
"copy",
*dict_to_flags(copy_flags),
"--from",
f"ssh://{from_host.host}",
"--to",
@@ -237,9 +237,9 @@ def test_copy_closure(monkeypatch: Any) -> None:
monkeypatch.setenv("NIX_SSHOPTS", "--ssh build-opt")
with patch(get_qualified_name(n.run_wrapper, n), autospec=True) as mock_run:
n.copy_closure(closure, None, build_host)
n.copy_closure(closure, None, build_host, copy_flag=True)
mock_run.assert_called_with(
["nix-copy-closure", "--from", "user@build.host", closure],
["nix-copy-closure", "--copy-flag", "--from", "user@build.host", closure],
extra_env={
"NIX_SSHOPTS": " ".join(p.SSH_DEFAULT_OPTS + ["--ssh build-opt"])
},
@@ -251,11 +251,12 @@ def test_copy_closure(monkeypatch: Any) -> None:
"NIX_SSHOPTS": " ".join(p.SSH_DEFAULT_OPTS + ["--ssh build-target-opt"])
}
with patch(get_qualified_name(n.run_wrapper, n), autospec=True) as mock_run:
n.copy_closure(closure, target_host, build_host)
n.copy_closure(closure, target_host, build_host, copy_flag=True)
mock_run.assert_called_with(
[
"nix",
"copy",
"--copy-flag",
"--from",
"ssh://user@build.host",
"--to",