Setting up a C++ project environment with nix
After setting up the project and playing around with it, we will parametrize the project description in order to automatically build it with different compilers and dependency library versions (GCC 7 & 8, Clang 7 & 8, lib 1.6.6 – 1.6.9, lib 1.9.0 & 1.9.1). More information about nix derivations:
It looks like we’re using as a build system now – in fact, is a function that creates a so called “builder script” that is able to detect if we are using a Makefile based project (with or without autoconf), a CMake project, or a set of other build systems, and then executes the right steps according to the build system. I am running my own instance on https://hydra.kosmosgame.com and installed this project as a jobset on it:
The code does a bit more than covered in this article: I added a nix expression that does not only build the application in all variants, but also executes them and stores their results in the nix store.
Source: blog.galowicz.de