From dc9a2450d6007e327620850e4dae731213777b1b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=9B=A7-440729=20=5Bsophie=5D?= Date: Fri, 27 Jun 2025 23:41:17 +0200 Subject: [PATCH] make eval configurable, add help text to cli args --- src/config.rs | 19 +++++++++++++++++++ src/eval.rs | 7 +++---- 2 files changed, 22 insertions(+), 4 deletions(-) diff --git a/src/config.rs b/src/config.rs index 53d2f70..7ad4bc3 100644 --- a/src/config.rs +++ b/src/config.rs @@ -1,9 +1,28 @@ #[derive(clap::Parser, Debug)] pub struct Options { #[arg(long = "system", short)] + /// list of systems to build for pub systems: Vec, + + #[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, + + #[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, } diff --git a/src/eval.rs b/src/eval.rs index 6cc5f38..32b88a7 100644 --- a/src/eval.rs +++ b/src/eval.rs @@ -16,15 +16,14 @@ pub async fn nix_eval_jobs( result_tx: Sender, ) -> 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");