hive: Convert derivations to drvPath in separate attribute

This is to make way for the nix-eval-jobs streaming evaluator.
This commit is contained in:
Zhaofeng Li 2022-01-21 00:45:12 -08:00
parent 7e15450fd2
commit 3fa0dee6b0
2 changed files with 4 additions and 4 deletions

View file

@ -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;

View file

@ -259,7 +259,7 @@ impl Hive {
pub async fn eval_selected(&self, nodes: &[NodeName], job: Option<JobHandle>) -> ColmenaResult<HashMap<NodeName, ProfileDerivation>> {
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?;