From 62a1f1a9a9510328d5508df94cdaf58525f80eff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Tue, 17 Jun 2025 12:50:48 +0200 Subject: [PATCH] machines: fix remote-program for darwin nix copy 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. This restores the remote-program parameter that was accidentally removed in commit cff5d61f26. --- pkgs/clan-cli/clan_cli/machines/update.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/pkgs/clan-cli/clan_cli/machines/update.py b/pkgs/clan-cli/clan_cli/machines/update.py index 4e1dd8912..b3e9da094 100644 --- a/pkgs/clan-cli/clan_cli/machines/update.py +++ b/pkgs/clan-cli/clan_cli/machines/update.py @@ -55,6 +55,12 @@ def upload_sources(machine: Machine, ssh: Remote) -> str: is_local_input(node) for node in flake_data["locks"]["nodes"].values() ) + # Construct the remote URL with proper parameters for Darwin + remote_url = f"ssh://{ssh.target}" + # 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_url += "?remote-program=bash -lc 'exec nix-daemon --stdio'" + if not has_path_inputs: # Just copy the flake to the remote machine, we can substitute other inputs there. path = flake_data["path"] @@ -62,7 +68,7 @@ def upload_sources(machine: Machine, ssh: Remote) -> str: [ "copy", "--to", - f"ssh://{ssh.target}", + remote_url, "--no-check-sigs", path, ] @@ -84,7 +90,7 @@ def upload_sources(machine: Machine, ssh: Remote) -> str: "flake", "archive", "--to", - f"ssh://{ssh.target}", + remote_url, "--json", flake_url, ]