[Nix-dev] On the sad state of remote-builds for the end-user

zimbatm zimbatm at zimbatm.com
Thu Jun 16 00:35:08 CEST 2016


Aha, all my machines are running NixOS so that's probably your issue. My
guess is that you first need the nix-daemon to be running on the build
machine for all of this to work.

On Wed, 15 Jun 2016 at 14:16 Matthias Beyer <mail at beyermatthias.de> wrote:

> On 15-06-2016 11:10:09, zimbatm wrote:
> > my build machine is currently down but I used to have something like
> this:
> > HOWTO remote builds
> >
> >    - client: your laptop
> >    - build machine: the server that has tons of CPU
> >
> > On the build machine, install your client’s ssh public in the
> > /root/.ssh/authorized_keys.
>
> Is your build machine a nixos machine or a non-nixos with nix installed?
> If the
> latter: How did you install nix? I assume as root user, right?
>
> >
> > On the client add something like this in your configuration.nix:
> >
> > {
> >   networking.extraHosts = ''
> >     # FIX THE IP HERE
> >     192.168.0.8 my-build-machine
> >   '';
> >   nix.maxJobs = 1; # set to 0 to force remote building
> >   nix.distributedBuilds = true;
> >   nix.buildMachines = [
> >     { hostName = "my-build-machine"; # I have the hostname in my
> extraHosts
> >       maxJobs = 6; # set to number of CPUs
> >       sshKey = "/home/myuser/.ssh/id_ecdsa";
> >       sshUser = "root";
> >       system = "x86_64-linux";
> >     }
> >   ];
> > }
> >
> > Apply the config. You should be good to.
> > Missing things
> >
> > In cases where the laptop is on another network you want to disable the
> > distributed build. Especially if maxJobs = 0 you could end up in a
> > situation where you can’t build the new configuration because of that.
> I’m
> > sure there is a command-line or environment variable to change that
> config
> > at runtime but I don’t know how to switch this.
>
> That's the point: I don't want to disable it on commandline if I have to,
> but to
> enable it on commandline if I have the possibility to do distributed
> builds.
> I played around with `<nix command> --option` and setting configuration
> there,
> but I failed to get it working. I did not install nix on the remote
> machine as
> root, though. That might be the point.
>
> --
> Mit freundlichen Grüßen,
> Kind regards,
> Matthias Beyer
>
> Proudly sent with mutt.
> Happily signed with gnupg.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.science.uu.nl/pipermail/nix-dev/attachments/20160615/ddf892d9/attachment.html>


More information about the nix-dev mailing list