nix-eval-jobs/tests/assets/ci.nix
adisbladis 61c9f4cfcc Replace internal attr string representation with an array
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"
}
```
2022-04-26 19:43:56 +12:00

37 lines
670 B
Nix

{
pkgs ? import (builtins.getFlake (toString ./.)).inputs.nixpkgs { }
, system ? pkgs.system
}:
{
builtJob = pkgs.writeText "job1" "job1";
substitutedJob = pkgs.hello;
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
drvB = derivation {
inherit system;
name = "drvB";
builder = ":";
};
};
"dotted.attr" = pkgs.hello;
}