Open kjeremy opened 2 years ago
The manual mentions you'll have to either specify --builders "...."
or configure /etc/nix/machines
.
What's the difference between using builders and --store
? I thought that specifying --store
would be a remote build.
AFAIK, -j0
is 0 jobs on your own store, which you specify with --store
, so this is working as intended.
@kjeremy, --store
specifies a different and newer kind of remote build. Since the entire build process takes place on the remote machine without copying closures back and forth, it is much more efficient. It run basically as if you had sshed to the machine and run the build there directly.
It works completely differently than the old remote build protocol, and max-jobs 0
wouldn't be necessary since the local store is not involved at all.
$ nix-build ... -j 0 --builders "ssh://abc def" -vvvvv
...
starting build hook '/nix/store/hcs9kmk8hsqhd4nkqmlwkcz1iaklp8al-nix-2.11.1/bin/nix __build-remote'
got 0 remote builders
hook reply is 'decline-permanently'
killing process 84827
...
$ nix --version
nix (Nix) 2.11.1
Adding the user to trustedUsers
seems to be doing the trick in my case
Quite confusing that neither error message nor https://nixos.org/manual/nix/stable/advanced-topics/distributed-builds.html mentions that.
But https://nixos.wiki/wiki/Distributed_build does.
Added it via nix.settings.trusted-users = [ "username" ];
in configuration.nix
Describe the bug
The manual says
However
nix build --eval-store auto --store ssh-ng://... --max-jobs 0 nixpkgs#hello
fails withSteps To Reproduce
nix build --eval-store auto --store ssh-ng://... --max-jobs 0 .#flake_target
Expected behavior
The build executed on the remote.
nix-env (Nix) 2.11.0