Skip to content

Builder Developer Information

Sven Ziegler edited this page Apr 19, 2026 · 8 revisions

Setup

To start developing, clone the repo and run nix develop to install all python requirements:

git clone https://iglu-sh/iglu
nix develop

General Dev Information

The Builder is written in Python using FastAPI, our Linter is Basedpyright and the files live in /builder.

The project structure is as follows:

  • main.py: main program
  • static: all static pages live here
  • app: in this directory are all needed components
  • templates: all needed jinja2 templates will go here

Api (routes) Structure

We follow these route sturctures:

  • /api/v1/*: here are any REST-API and Websocket endpoints
  • /: this is a small welcome page with a simple test interface
  • /docs: from FastAPI generated api documentation

Starting a build process

To start a build process you have to follow this short manual:

  1. start developing mode: cd builder fastapi dev
  2. connect to websocket via http://localhost:8000/api/v1/build
  3. send a builder config via this websocket
  4. wait until your build has fnished

Builder-Config schema

Key Values Description
command <list<string>> Command to execute seperated as list. This command hast to start with nix or nix-build
cwd <string> Optional parameter to set a working directory, default is /tmp/iglu_builder
repo.clone <boolean> Whenever to clone a given git repository
repo.url <string> Url of the git repository
repo.branch <string> Optional parameter to select a specific branch, if not set the default branch will be cloned
cache.push <boolean> Whenever to push the build derivation
cache.url <string> Url of the cachix compatible cache
cache.auth_token <string> The authtoken of the cachix compatible cache
cache.signing_key <string> The signingkey which is used to sign every derivation

Example config

{
    "command": ["nix", "build", ".#nixosConfigurations.SYSTEM.config.system.build.toplevel"],
    "cwd": "/my/path/to/the/repo",
    "repo": {
        "clone": true,
        "url": "https://github.com/your/repo",
        "branch": "my-branch"
    },
    "cache": {
        "push": true,
        "url": "https://cache.example.com/cache",
        "auth_token": "your_super_secret_token",
        "signing_key": "your_super_secret_signing_key"
    }
}

Clone this wiki locally