Skip to content

Commit 58e948d

Browse files
committed
nixos-rebuild-ng: add missing copy_flags for nix copy
1 parent 255c9b0 commit 58e948d

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

pkgs/by-name/ni/nixos-rebuild-ng/src/nixos_rebuild/nix.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,7 @@ def nix_copy(to_host: Remote, from_host: Remote) -> None:
192192
[
193193
"nix",
194194
"copy",
195+
*dict_to_flags(copy_flags),
195196
"--from",
196197
f"ssh://{from_host.host}",
197198
"--to",

pkgs/by-name/ni/nixos-rebuild-ng/src/tests/test_nix.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -237,9 +237,9 @@ def test_copy_closure(monkeypatch: Any) -> None:
237237

238238
monkeypatch.setenv("NIX_SSHOPTS", "--ssh build-opt")
239239
with patch(get_qualified_name(n.run_wrapper, n), autospec=True) as mock_run:
240-
n.copy_closure(closure, None, build_host)
240+
n.copy_closure(closure, None, build_host, copy_flag=True)
241241
mock_run.assert_called_with(
242-
["nix-copy-closure", "--from", "[email protected]", closure],
242+
["nix-copy-closure", "--copy-flag", "--from", "[email protected]", closure],
243243
extra_env={
244244
"NIX_SSHOPTS": " ".join(p.SSH_DEFAULT_OPTS + ["--ssh build-opt"])
245245
},
@@ -251,11 +251,12 @@ def test_copy_closure(monkeypatch: Any) -> None:
251251
"NIX_SSHOPTS": " ".join(p.SSH_DEFAULT_OPTS + ["--ssh build-target-opt"])
252252
}
253253
with patch(get_qualified_name(n.run_wrapper, n), autospec=True) as mock_run:
254-
n.copy_closure(closure, target_host, build_host)
254+
n.copy_closure(closure, target_host, build_host, copy_flag=True)
255255
mock_run.assert_called_with(
256256
[
257257
"nix",
258258
"copy",
259+
"--copy-flag",
259260
"--from",
260261
261262
"--to",

0 commit comments

Comments
 (0)