make eval configurable, add help text to cli args

This commit is contained in:
⛧-440729 [sophie] 2025-06-27 23:41:17 +02:00
parent 657f324865
commit dc9a2450d6
No known key found for this signature in database
GPG key ID: 8566000000440729
2 changed files with 22 additions and 4 deletions

View file

@ -1,9 +1,28 @@
#[derive(clap::Parser, Debug)]
pub struct Options {
#[arg(long = "system", short)]
/// list of systems to build for
pub systems: Vec<String>,
#[arg(long, default_value = ".#checks")]
/// flake ref to evaluate for jobs
pub flake_path: String,
#[arg(long)]
/// whether to check the cache status for derivations
///
/// if true, cached derivations will not be built
pub check_cached: bool,
#[arg(long)]
/// store uri where build outputs will be uploaded to
pub copy_to: Option<String>,
#[arg(long, default_value = "4")]
/// maximum number of evaluation workers
pub eval_workers: u8,
#[arg(long, default_value = "4096")]
/// maximum allowed amount of memory in mib per eval worker
pub eval_worker_memory: u32,
}

View file

@ -16,15 +16,14 @@ pub async fn nix_eval_jobs(
result_tx: Sender<NixCiResult>,
) -> anyhow::Result<()> {
let mut command = Command::new("nix-eval-jobs");
// TODO: make this configurable
command.args(&[
"--force-recurse",
"--max-memory-size",
"3072",
format!("{}", opts.eval_worker_memory).as_str(),
"--workers",
"4",
format!("{}", opts.eval_workers).as_str(),
"--flake",
".#checks",
opts.flake_path.as_str(),
]);
if opts.check_cached {
command.arg("--check-cache-status");