Skip to content

Commit 3dcc8bc

Browse files
committed
BuildbotNixConfig: apply more defaults in base model
This makes using the api directly more pleasant.
1 parent 3cbc558 commit 3dcc8bc

File tree

2 files changed

+19
-16
lines changed

2 files changed

+19
-16
lines changed

buildbot_nix/buildbot_nix/models.py

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -261,26 +261,28 @@ class WorkerConfig(BaseModel):
261261

262262
class BuildbotNixConfig(BaseModel):
263263
db_url: str
264-
auth_backend: AuthBackendConfig
265-
gitea: GiteaConfig | None
266-
github: GitHubConfig | None
267-
pull_based: PullBasedConfig | None
268-
admins: list[str]
269264
build_systems: list[str]
270-
eval_max_memory_size: int
271-
eval_worker_count: int | None
272-
local_workers: int = 0
273-
nix_workers_secret_file: Path | None = None
274265
domain: str
275266
webhook_base_url: str
276-
use_https: bool
277-
outputs_path: Path | None
278267
url: str
279-
post_build_steps: list[PostBuildStep]
280-
job_report_limit: int | None
281-
http_basic_auth_password_file: Path | None
282-
effects_per_repo_secrets: dict[str, str]
283-
branches: BranchConfigDict
268+
269+
use_https: bool = False
270+
auth_backend: AuthBackendConfig = AuthBackendConfig.none
271+
eval_max_memory_size: int = 4096
272+
admins: list[str] = []
273+
local_workers: int = 0
274+
eval_worker_count: int | None = None
275+
gitea: GiteaConfig | None = None
276+
github: GitHubConfig | None = None
277+
pull_based: PullBasedConfig | None
278+
outputs_path: Path | None = None
279+
post_build_steps: list[PostBuildStep] = []
280+
job_report_limit: int | None = None
281+
http_basic_auth_password_file: Path | None = None
282+
branches: BranchConfigDict = BranchConfigDict({})
283+
284+
nix_workers_secret_file: Path | None = None
285+
effects_per_repo_secrets: dict[str, str] = {}
284286

285287
def nix_worker_secrets(self) -> WorkerConfig:
286288
if self.nix_workers_secret_file is None:

nixosModules/master.nix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -780,6 +780,7 @@ in
780780
value = "effects-secret__${cleanUpRepoName name}";
781781
}) cfg.effects.perRepoSecretFiles;
782782
branches = cfg.branches;
783+
nix_workers_secret_file = "buildbot-nix-workers";
783784
}
784785
}").read_text()))
785786
)

0 commit comments

Comments
 (0)