From 1195ff3b286fc6abf53a61258a4750e7f1abfc23 Mon Sep 17 00:00:00 2001 From: Raito Bezarius Date: Sun, 27 Oct 2024 22:01:05 +0100 Subject: [PATCH] feat: enable auto-call behavior for non-Flakes entrypoints This way, we can easily switch between any. TODO would be to automatically filter out `incoming_ref_data` if it doesn't appear. Signed-off-by: Raito Bezarius --- buildbot_nix/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/buildbot_nix/__init__.py b/buildbot_nix/__init__.py index 8010b92..0ec0162 100644 --- a/buildbot_nix/__init__.py +++ b/buildbot_nix/__init__.py @@ -475,7 +475,7 @@ def make_job_evaluator(name: str, settings: EvaluatorSettings, flake: bool, inco actual_command += ["--flake", f".#{FLAKE_TARGET_ATTRIBUTE_FOR_JOBS}"] else: actual_command += ["--expr", - f"import ./.ci/buildbot.nix {{ incoming_ref_data = builtins.fromJSON (builtins.readFile {incoming_ref_filename}); }}"] + f"let fn = import ./.ci/buildbot.nix; in if (builtins.isFunction fn) then (fn {{ incoming_ref_data = builtins.fromJSON (builtins.readFile {incoming_ref_filename}); }}) else fn"] return NixEvalCommand( env={},