Botanix is a VCS agnostic CI system aiming to replicate Buildkite experience with Nix native primitives.
  • Rust 98.1%
  • Nix 1.9%
Find a file
2026-03-06 19:16:05 +01:00
nix nixos module: don't use nixbld group 2026-03-03 11:39:13 +01:00
packaging config: default to checkout_dir in CACHE_DIRECTORY, not RUNTIME_DIRECTORY 2026-03-06 17:55:28 +01:00
proto ADD: botanix-cli with db connexion + protocol 2025-12-27 03:44:18 +00:00
src gerrit: implement status updates 2026-03-06 19:16:05 +01:00
tests Remove obsolete grpc_port 2026-03-03 11:18:15 +01:00
.envrc linus's envrc 2026-03-03 11:21:11 +01:00
.gitignore ADD: Nix flake with NixOS module and integration tests 2026-01-03 10:00:49 +00:00
AUTHORS.md ADD: initial commit : main + cli parser + env config + errors 2025-10-17 01:02:04 +02:00
build.rs cargo fmt 2026-02-23 12:47:20 +01:00
Cargo.lock 2026-03-03 11:45:01 +01:00
Cargo.toml 2026-03-03 11:45:01 +01:00
flake.lock ADD: Nix flake with NixOS module and integration tests 2026-01-03 10:00:49 +00:00
flake.nix ADD: build + change checks to hydraJobs to prepare tests botanix by botanix 2026-01-03 23:06:09 +00:00
LICENSE.md ADD: LICENSE.md 2025-11-14 23:24:15 +00:00
README.md Remove obsolete grpc_port 2026-03-03 11:18:15 +01:00

Botanix

A distributed CI/CD system for Nix projects with webhook integration for Git forges.

Overview

Botanix is coordinator-worker system that builds Nix derivations in response to Git webhooks.

Quick Start

Prerequisites

  • Rust (lastest stable)
  • Nix with flakes enabled

Start the coordinator (Server)

export WEBHOOK_SECRET='YOUR_WEBHOOK_SECRET'
export FORGEJO_API='https://your-forge.example.com/api/v1/'
export FORGEJO_TOKEN='your_personal_access_token'
cargo run -- --mode server

Start a Worker

First you need a WORKER_TOKEN. You can obtain one by registering with coordinator:

curl -s -X POST YOUR_COORDINATOR_URL:YOUR_PORT/worker/register \
    -H 'Content-Type: application/json' \
    -d '{"systems":[SYSTEM_OF_YOUR_WORKER]}'

Now you can start the worker with the obtained token:

export COORDINATOR_URL='YOUR_COORDINATOR_URL'
export WORKER_TOKEN='YOUR_WORKER_TOKEN_GET_IN_THE_LAST_STEP'
cargo run -- --mode worker

Configure a Webhook

Add a webhook to your Git repository, for now available PROVIDER are { forgejo }

  • URL: http://your-server:8080/webhooks/PROVIDER
  • SECRET: Same as WEBHOOK_SECRET
  • EVENTS: Push events, Pull Request events.

Configuration

Server

  • Required:

    • WEBHOOK_SECRET: HMAC secret for validating webhooks
    • NIX_SYSTEMS: Comma separated systems this server supports (default: x86_64-linux).
  • Optional:

    • FORGEJO_API: Forgejo API base URL for status updates.
    • FORGEJO_TOKEN: Personal Acess Token for Forgejo API.
    • PORT: Coordinator http Port, (default: 8080)

Worker

  • Required:

    • COORDINATOR_URL: Coordinator server base URL
    • WORKER_TOKEN: Authentication token.
    • NIX_SYSTEMS: Comma separated systems this worker supports (default: x86_64-linux).
  • Optional:

    • CACHE_URL: Nix binary cache URL for substitutions.
    • CACHE_NETRC_PATH: Path to .netrc file for authenticated cache access.
    • CHECKOUT_DIR: Directory to store git checkouts (default: follows systemd hierarchy).

Checkout Directory configuration

The worker stores cloned git repositories in a checkout directory. By default, this directory is determined in the following order:

Priority order:

  1. CHECKOUT_DIR environment variable (if set by the user).
  2. $RUNTIME_DIRECTORY/botanix/checkouts (if RUNTIME_DIRECTORY is set, typically by systemd).
  3. $TMPDIR/botanix/checkouts (if TMPDIR is set).
  4. /tmp/botanix/checkouts (default fallback).