About remote build machine

  1. If I interrupt the build process, e.g. Ctrl+C, will the remote building be canceled as well?
  2. Will different version of nix affect the output? When I do nixos-rebuild, it will fetch the latest nix and use it to build package and configurations. Does this matter? And should I regularly update the nix package on the remote machine manually?
1 Like
  1. yes, that’s so in my experience. Even if some other build (that wasn’t cancelled) is waiting for the same build step.
  2. no, it shouldn’t. We try to keep compatibility. IMHO having sandboxing or not is the largest practical difference; I recommend to turn it on, to decrease various issues in packages.

Hi @vcunat, thanks for your reply! So is there a way to “delegate” all the building stuff to a remote machine and fetch it later when I nixos-rebuild? It always took hours to build the kernel and virtualbox with extension pack, and I don’t want to keep the process running…

1 Like

You can start a build on the remote machine, have services.nix-serve
running and configure it as a binary cache.

Or, you can nix-copy-closure your drv to the remote, do nix-store -r there
and nix-copy-closure the result back.

Frank

… or you can set up nix doing these automatically, which is probably more complex to set up but easier to use afterwards. nix docs; on nixos some parts are easier.

1 Like

Also, see https://nixos.wiki/wiki/Distributed_build in the wiki.

Or, you can nix-copy-closure your drv to the remote, do nix-store -r there
and nix-copy-closure the result back.

This approach was documented by @danbst in this gist which seems to be the only progress on this use case.

1 Like