update/flake-upload: set correct remote-program for macOS targets

This commit is contained in:
Jörg Thalheim
2025-08-05 13:33:08 +02:00
parent 6bb998f9dd
commit 98f685f3ca

View File

@@ -52,12 +52,12 @@ def upload_sources(machine: Machine, ssh: Host, force_fetch_local: bool) -> str:
remote_url_base = ssh.target
remote_program_params = ""
# MacOS doesn't come with a proper login shell for ssh and therefore doesn't have nix in $PATH as it doesn't source /etc/profile
if machine._class_ == "darwin":
remote_program_params = "?remote-program=bash -lc 'exec nix-daemon --stdio'"
if not has_path_inputs and not force_fetch_local:
# Just copy the flake to the remote machine, we can substitute other inputs there.
path = flake_data["path"]
if machine._class_ == "darwin":
remote_program_params = "?remote-program=bash -lc 'exec nix-daemon --stdio'"
remote_url = f"ssh-ng://{remote_url_base}{remote_program_params}"
cmd = nix_command(
[
@@ -83,6 +83,10 @@ def upload_sources(machine: Machine, ssh: Host, force_fetch_local: bool) -> str:
# Don't use ssh-ng here. It makes `flake archive` fail, despite root@..., with:
# cannot add path '/nix/store/...' because it lacks a signature by a trusted key
# The issue is the missing `--no-check-sigs` option in `nix flake archive`.
if machine._class_ == "darwin":
remote_program_params = (
"?remote-program=bash -lc 'exec nix-store --serve --write'"
)
remote_url = f"ssh://{remote_url_base}{remote_program_params}"
cmd = nix_command(
[