parent
b5629dca83
commit
2b0bafa155
2 changed files with 25 additions and 1 deletions
|
@ -190,7 +190,8 @@ let
|
||||||
evalSelectedDrvPaths = names: lib.mapAttrs (k: v: v.drvPath) (evalSelected names);
|
evalSelectedDrvPaths = names: lib.mapAttrs (k: v: v.drvPath) (evalSelected names);
|
||||||
|
|
||||||
introspect = function: function {
|
introspect = function: function {
|
||||||
inherit nixpkgs lib;
|
inherit lib;
|
||||||
|
pkgs = nixpkgs;
|
||||||
nodes = uncheckedNodes;
|
nodes = uncheckedNodes;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -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);
|
||||||
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue