eval.nix: Restore signature in introspect

It was broken in 9bd5e7bb25.
This commit is contained in:
Zhaofeng Li 2022-06-09 11:31:49 -07:00
parent b5629dca83
commit 2b0bafa155
2 changed files with 25 additions and 1 deletions

View file

@ -190,7 +190,8 @@ let
evalSelectedDrvPaths = names: lib.mapAttrs (k: v: v.drvPath) (evalSelected names);
introspect = function: function {
inherit nixpkgs lib;
inherit lib;
pkgs = nixpkgs;
nodes = uncheckedNodes;
};

View file

@ -519,3 +519,26 @@ fn test_hive_autocall() {
}
"#);
}
#[test]
fn test_hive_introspect() {
let hive = TempHive::new(r#"
{
test = { ... }: {
boot.isContainer = true;
};
}
"#);
let expr = r#"
{ pkgs, lib, nodes }:
assert pkgs ? hello;
assert lib ? versionAtLeast;
nodes.test.config.boot.isContainer
"#.to_string();
let eval = block_on(hive.introspect(expr, false))
.unwrap();
assert_eq!("true", eval);
}