nix-darwin icon indicating copy to clipboard operation
nix-darwin copied to clipboard

SSH connection with linux-builder fails

Open workingdoge opened this issue 4 months ago • 2 comments

I'm able to ssh into linux-builder when I manually pass the ssh key and config, so the instance is running.

Failing with error: connecting to 'ssh-ng://builder@linux-builder'... cannot build on 'ssh-ng://builder@linux-builder': error: failed to start SSH connection to 'builder@linux-builder'

  nix = {
    settings = {
      trusted-users = [
        currentSystemUser
        "@admin"
      ];
      extra-trusted-users = [
        "@admin"
        currentSystemUser
      ];
      experimental-features = ["nix-command" "flakes" "repl-flake"];
      keep-outputs = true;
      keep-derivations = true;
    };
    extraOptions = ''
      extra-platforms = x86_64-darwin aarch64-darwin
    '';
    linux-builder = {
      enable = true;
      ephemeral = true;
      maxJobs = 4;
      config = {
        virtualisation = {
          darwin-builder = {
            diskSize = 40 * 1024;
            memorySize = 8 * 1024;
          };
          cores = 6;
        };
      };
    };
  };

Not quite sure how to introspect the ssh session when calling nix build

workingdoge avatar Mar 23 '24 00:03 workingdoge

I've been working on something similar.

One thing I did find, which may help you, is that if you are going to overwrite "config" it might be necessary to also enable SSH. In other words, add services.openssh.enable = true to config = { .. }

Secondly, it doesn't seem like logging is enabled by default. I had to add the following to my top level config: launchd.daemons.linux-builder = { serviceConfig = { StandardOutPath = "/var/log/darwin-builder.log"; StandardErrorPath = "/var/log/darwin-builder.log"; }; }; After which, I could view logs on my host machine located at "/var/log/darwin-builder.log".

Hope some of this helps.

daveterra avatar Apr 28 '24 16:04 daveterra

I'm able to successfully build with the linux-builder however unable to personally ssh in. What is the password is it asking for?

georgealexanderday avatar May 01 '24 19:05 georgealexanderday