From 98f685f3ca11aa5076eaf7039f84bca85c67ee60 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Tue, 5 Aug 2025 13:33:08 +0200 Subject: [PATCH] update/flake-upload: set correct remote-program for macOS targets --- pkgs/clan-cli/clan_lib/machines/update.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/pkgs/clan-cli/clan_lib/machines/update.py b/pkgs/clan-cli/clan_lib/machines/update.py index eeb53d00c..fe5919e8e 100644 --- a/pkgs/clan-cli/clan_lib/machines/update.py +++ b/pkgs/clan-cli/clan_lib/machines/update.py @@ -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( [