Lightning-fast CI with nixbuild.net

You can now run builds on nixbuild.net like this:

nix build --eval-store auto --store ssh-ng://eu.nixbuild.net ...

This “remote store” usage means that the build will performed entirely on the remote side (nixbuild.net in this case), with no build inputs or build outputs fetched to the local store. For some setups (like CI environments with “empty” runners, like GitHub Actions) this can avoid a whole lot of closure copying, improving build times for certain builds tremendously.

Check out my blog post if this sounds interesting: Lightning-fast CI with nixbuild.net

16 Likes

How does this work in presence of IFD?

1 Like

It works fine! Here I’m building the IFD example from the NixOS wiki:

$ nix build ".#test-builds/ifd" \
    -v \
    --option allow-import-from-derivation true \
    --eval-store auto \
    --store ssh-ng://eu.nixbuild.net

building '/nix/store/602cybzp7c8349dk10rkkvsavh6idhm1-example.drv'...
copying 1 paths...
copying path '/nix/store/iqwcnnvkpsldjrb3v1gxl9yml6yj7131-hello-2.10-ifd-example.94235f45.drv' to 'ssh-ng://eu.nixbuild.net'...
building '/nix/store/iqwcnnvkpsldjrb3v1gxl9yml6yj7131-hello-2.10-ifd-example.94235f45.drv'...

As you can see, the generated derivation is built and evaluated locally first, then the resulting .drv is uploaded to nixbuild.net and built there.

If your generated derivation needs a lot of build inputs I guess it will defeat some of the purpose of remote store building, since Nix then will need to fetch those closures locally. I think that Nix can run the actual builds of the generated derivations on nixbuild.net, but then you need to specify --builders (or configure /etc/nix/machines) in addition to the store options. I have not tested this.

1 Like
Hosted by Flying Circus.