From 3fa0dee6b07af09ea4fa6337ef5740bf3d3de732 Mon Sep 17 00:00:00 2001 From: Zhaofeng Li Date: Fri, 21 Jan 2022 00:45:12 -0800 Subject: [PATCH] hive: Convert derivations to drvPath in separate attribute This is to make way for the nix-eval-jobs streaming evaluator. --- src/nix/hive/eval.nix | 6 +++--- src/nix/hive/mod.rs | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/nix/hive/eval.nix b/src/nix/hive/eval.nix index 385e413..58b5fc6 100644 --- a/src/nix/hive/eval.nix +++ b/src/nix/hive/eval.nix @@ -510,8 +510,8 @@ let evalAll = evalSelected nodeNames; evalSelected = names: let selected = lib.filterAttrs (name: _: elem name names) toplevel; - drvs = lib.mapAttrs (k: v: v.drvPath) selected; - in drvs; + in selected; + evalSelectedDrvPaths = names: lib.mapAttrs (k: v: v.drvPath) (evalSelected names); introspect = function: function { inherit pkgs lib nodes; @@ -520,7 +520,7 @@ in { inherit nodes toplevel deploymentConfig deploymentConfigSelected - evalAll evalSelected introspect; + evalAll evalSelected evalSelectedDrvPaths introspect; meta = hive.meta; diff --git a/src/nix/hive/mod.rs b/src/nix/hive/mod.rs index 96c43d2..a3d1ea0 100644 --- a/src/nix/hive/mod.rs +++ b/src/nix/hive/mod.rs @@ -259,7 +259,7 @@ impl Hive { pub async fn eval_selected(&self, nodes: &[NodeName], job: Option) -> ColmenaResult> { let nodes_expr = SerializedNixExpresssion::new(nodes)?; - let expr = format!("hive.evalSelected {}", nodes_expr.expression()); + let expr = format!("hive.evalSelectedDrvPaths {}", nodes_expr.expression()); let command = self.nix_instantiate(&expr) .eval_with_builders().await?;