This repository contains code samples used in the C++ Serbia meetup on Nix package manager.
- cpp-nix-project-template - Project template for C++ project, and Nix as a package manager
- kotur-nixpkgs - Custom nixpkgs channel
- cpp-rest-server - Demo project, uses cpp-nix-project-template.
- C++ compiler, CMake
- Conan package manager (
03_conan
) - Nix package manager (
04_nix-shell
,05_nix
) - Docker (
02_docker
) - Libraries: SDL2, SDL2_ttf, fmt, spdlog
There are multiple directories, all containing same app but different way of getting dependencies
01_system
: Relies on a system package manager
mkdir build && cd build
cmake .. -DCMAKE_BUILD_TYPE=Debug
make
02_docker
: Relies on Docker
docker build -t hello_cpp_serbia .
docker run hello_cpp_serbia
# You will probably need to stop it
docker stop $(docker ps -a -q --filter ancestor=hello_cpp_serbia)
03_conan
: Relies on the Conan package manager
mkdir build
cd build
cmake .. -DCMAKE_BUILD_TYPE=Debug
make
04_nix-shell
: Relies on the Nix package manager
nix-shell
mkdir build
cd build
cmake .. -DCMAKE_BUILD_TYPE=Debug
make
05_nix
: Relies on the Nix package manager
nix-build
./result/bin/hello_cpp_serbia ../OpenSans-Regular.ttf
App requires one argument (ttf font) which will be used when rendering the message.
Specify relative path to ./OpenSans-Regular.ttf as a first argument, depending on where are you calling app from.
./result/bin/hello_cpp_serbia <REPO_ROOT>/OpenSans-Regular.ttf
For more instructions look at the cpp-nix-project-template