Currently, not a lot of things expose inputDrvs (except
`show-derivation`), which is a showstopper whenever you want to compute
popularity ranking based on the dependency relation.
Having `inputsDrvs` in the reply enable downstream users to perform such
computations in an efficient way.
Fixes#134
Use the `InstallableFlake` type in order to make use of it's `toValue`
method. This fixes the functor auto-call by including the work from
nixos/nix#6404.
Future work may make use of this object and its methods to employ the
flake based eval cache.
This ensures correct handling of attrnames with a dot in them and will
not throw errors about illegal attrnames.
Additionally this escapes any attributes containing dots in the JSON
output and adds another field called `attrPath` which contains the
attribute path as a list.
Example output:
```
{
"attr": "hello",
"attrPath": [
"hello"
],
"drvPath": "/nix/store/n204jib73z55cp9s0rmw1c5v5q528j7v-hello-2.12.drv",
"name": "hello-2.12",
"outputs": {
"out": "/nix/store/h59dfk7dwrn7d2csykh9z9xm2miqmrnz-hello-2.12"
},
"system": "x86_64-linux"
}
```
This will respect `recurseForDerivations` when iterating over attrsets.
Example expression:
``` nix
{ system ? builtins.currentSystem }:
{
recurseForDerivations = true;
# This should build as it's in the top-level attrset
drvA = derivation {
inherit system;
name = "drvA";
builder = ":";
};
dontRecurse = {
# This shouldn't build as `recurseForDerivations = true;` is not set
# recurseForDerivations = true;
# This should not build
drvB = derivation {
inherit system;
name = "drvA";
builder = ":";
};
};
recurse = {
# This should build
recurseForDerivations = true;
# This should not build
drvC = derivation {
inherit system;
name = "drvC";
builder = ":";
};
};
}
```
The default buffering behavior depends on whether the output is connected
to an interactive device. This causes output lines to be buffered in an
undesirable way when stdout is piped, which is how nix-eval-jobs is
normally used. Let's fix it by flushing stdout explicitly.
I removed meta from the output in 434376f8e1 with the intention of adding it back gated by a flag, but that never happened.
Adding meta is quite a substantial increase in output size and has some non-trivial performance impact at scale, so it's best to leave it as opt-in.
The output of the evaluator should only include either the full
derivation (not yet implemented) or fields not directly accessible
from the drv such as meta.
Right now the output is a fairly arbitrary selection of fields.