- Confusing dependency management
- Environment setup varies per machine
- Toolchain configuration is complex
- Onboarding new devs takes hours/days
- Nix is a real (not C only) package manager with the biggest package library of all Linux distros!
- Zig has a build system and built-in compiler that cross-compiles better than gcc or clang!
- Containers isolate complex environments, no more setting up environment variables and installing a dozen dependencies!
$ zig build- Robust simplicity: default to simple and robust stack of components
- Container first: containers and nix coexist together to form the best of both worlds: reproducible environment setup and isolation
- Optionality: more complex components are included only if explicitly enabled
- Explicit configuration: options are configured by editing
build.zig(a real programming language, not some DSL) - Clear responsibility: each component does exactly one thing (well)
- Bootstrapability: builds and runs on minimal systems
- Reproducibility: builds should behave identically across machines
- No compromises: zero tolerance for sub-optimal tools
- Version control:
git - Build system: zig (build.zig)
- Compiler:
zig cc
- (Optional) Dependency management (and container image generation):
nixorlix(flake.nix) - (Optional) Testing: non-opinionated; in this example:
csds_test.h - (Optional) Container engine:
PodmanorDocker - (Optional) Documentation:
doxygen - (Optional) Error detection:
valgrind+cppcheck - (Optional) CI/CD: non-opinionated; in this example: GitHub Actions
- (Optional) Code formatting:
- C:
clang-format,astyle - Nix:
alejandra
- C:
zig buildzig build envzig build ctr_img??? study firstzig build testzig build cicdzig build docszig build valgrindzig build cppcheckzig build format
For more information:
$ zig build --help
- This template favors simplicity, explicitness, and minimal tooling.
- Integrations like LSP, CI/CD, containerization, or Nix shells are modular and optional.
- Ideal for systems programming, libraries, CLI tools, and embedded.