forked from DGNum/colmena
eval.nix: Auto-call functors as well
This makes some very cursed setup work :P
This commit is contained in:
parent
7757a0e45d
commit
ddccad4fb9
2 changed files with 12 additions and 1 deletions
|
@ -268,7 +268,7 @@ let
|
|||
in hive;
|
||||
|
||||
rawToHive = rawHive:
|
||||
if typeOf rawHive == "lambda" then rawHive {}
|
||||
if typeOf rawHive == "lambda" || rawHive ? __functor then rawHive {}
|
||||
else if typeOf rawHive == "set" then rawHive
|
||||
else throw "The config must evaluate to an attribute set.";
|
||||
in
|
||||
|
|
|
@ -427,6 +427,17 @@ fn test_hive_autocall() {
|
|||
}
|
||||
"#);
|
||||
|
||||
TempHive::valid(r#"
|
||||
{
|
||||
some = "value";
|
||||
__functor = self: { argument ? "with default value" }: {
|
||||
borg = { ... }: {
|
||||
boot.isContainer = assert self.some == "value"; true;
|
||||
};
|
||||
};
|
||||
}
|
||||
"#);
|
||||
|
||||
TempHive::invalid(r#"
|
||||
{
|
||||
thisWontWork
|
||||
|
|
Loading…
Add table
Reference in a new issue