Has the behavior of --build-host been changed?

I was upgrading an old laptop, that hadn’t seen meaningful update since November 2023. It’s a pretty weak laptop, so I used nixos-rebuild --build-host <local-ip-of-my-desktop> (Nix 2.17.1) and it worked great. Now that my laptop has been updated (Nix 2.28.3), I wanted to build something else, so again I used --build-host, but now it seemed to do nothing. When I put in an IP that wasn’t my desktop, it didn’t care, and did the same thing. When I forced it to not build locally using -j 0, I got the following:

error:
    Unable to start any build;
    either increase '--max-jobs' or enable remote builds.

I’ve looked through the nix configuration. I don’t see anything like remote-builds = true. I’m puzzled as to why this no longer works.

edit: I decided to just go back to the old generation where it worked to build my current config, and it gave me the same error. So now I’m even more confused.

can it contact the builder as root ?

It can if I specify the user, but I tried that and nixos-rebuild still fails in the same way. To be clear, you’re asking about trying to ssh into a non-root user as root, not about trying to ssh into a root user, correct?

okay, so making sure I add the user@ bit to the host did actually fix --builders not working. However --build-host still doesn’t work no matter what I do. I can proceed using --builders, but I’m still curious why --build-host doesn’t work.

I warm up the agent on my limited device (rpi4) first with:

sudo ssh <remoteuser>@<snapdragon>

Followed by:

sudo nixos-rebuild --build-host <remoteuser>@<snapdragon> switch

What output do you get with the above commands?

sudo ssh <user>@<host> succeeds
(Throwing in a -j0 in there to make sure I don’t get any false positives)
sudo nixos-rebuild --build-host <user>@<host> -j0 build
gives me the error in the original post.

What is the output of:

ssh <user>@<host> nixos-option nix.trustedUsers

and:

ssh <user>@<host> id

?

edit: anything in the logs of the remote host btw, if you execute sudo nixos-rebuild --build-host <user>@<host> switch ?

$ ssh mason@192.168.0.105 nixos-option nix.trustedUsers
Value:
  [
    "root"
    "mason"
    "root"
  ]

Type:
  submodule

Description:
  Alias of {option}`nix.settings.trusted-users`.

Declared by:
  /nix/store/vj980b72z6zb0yg6v0a7nzc9rcww3jmn-source/nixos/modules/config/nix.nix

Defined by:

evaluation warning: Obsolete option `nix.trustedUsers' is used. It was renamed to `nix.settings.trusted-users'.

$ ssh mason@192.168.0.105 id
uid=1000(mason) gid=100(users) groups=100(users),1(wheel),57(networkmanager),131(docker)

Nothing wrong there afaics.

What does the build host log?

Both hosts are running the same version of nix and nixos? Not that it should matter :thinking:

If you’re talking journalctl, nothing gets logged.

They are the same version of nix and nixos. They are different kernels though.