-
Notifications
You must be signed in to change notification settings - Fork 0
Builder Developer Information
Sven Ziegler edited this page Apr 28, 2026
·
8 revisions
To start developing, clone the repo and run nix develop to install all python requirements:
git clone https://iglu-sh/iglu
cd iglu/builder/src
nix developFor developing, we are usually setting dev_mode on in the config.toml:
echo <<EOF
[server]
dev_mode = true
EOF > config.tomlTo start the builder:
python -m iglu_builderThe Builder is written in Python using FastAPI, our Linter is Basedpyright and the files live in /builder.
The project structure is as follows:
-
config.toml.example: Exampleconfig.toml -
pyproject.toml: PyProject file, which is needed to build the application -
/src/iglu_builder/*.py: Classes and components that actually do something -
/src/iglu_builder/static: All static pages live here -
/src/iglu_builder/types/*.py: Types that do not much, except being types (sometimes with default values) -
/src/iglu_builder/templates/*.j2: All needed jinja2 templates will go here
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
The iglu builder configuration is written in TOML. This is what the different parameters actually do:
| Key | Values | Default | Description |
|---|---|---|---|
work_dir |
<path> |
/tmp/iglu_builder |
Path where are the jobs get executed |
allowed_commands |
<list<strings>> |
["nix", "nix-build"] |
Defines which commands can be executed by a build job |
| Key | Values | Default | Description |
|---|---|---|---|
dev_mode |
<bool> |
false |
If true the webserver refreshes after file change |
port |
<int> |
8000 |
The port on which the server is listening |
host |
<string> |
0.0.0.0 |
The host on which the server is listening |
[builder]
work_dir = "/tmp/iglu_builder"
allowed_commands = ["nix", "nix-build"]
[server]
port = 8000
host = "localhost"
dev_mode = trueTo start a build process you have to follow this short manual:
- start developing mode:
cd builderfastapi dev - connect to websocket via
http://localhost:8000/api/v1/build - send a builder config via this websocket
- wait until your build has fnished
| Key | Values | Description |
|---|---|---|
command |
<list<string>> |
Command to execute seperated as list. This command hast to start with nix or nix-build
|
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.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 |
{
"command": ["nix", "build", ".#nixosConfigurations.SYSTEM.config.system.build.toplevel"],
"repo": {
"url": "https://github.com/your/repo",
"branch": "my-branch"
},
"cache": {
"url": "https://cache.example.com/cache",
"auth_token": "your_super_secret_token",
"signing_key": "your_super_secret_signing_key"
}
}