Commit graph

11 commits

Author SHA1 Message Date
Jörg Thalheim 4d97e5a386 improve infinite recursion errors 2023-12-16 10:52:23 +01:00
Jörg Thalheim f970ec3524 add test for evaluation errors 2023-12-10 16:59:14 +01:00
Jörg Thalheim 40ad828088 update flakes to fix tests on macos 2023-12-10 08:31:27 +00:00
adisbladis 276b68bade Apply statix/deadnix 2023-07-21 01:41:41 +00:00
adisbladis 516fdc8f6c Add treefmt
And use it in place of editorconfig/nixpkgs-fmt checks
2022-04-26 21:20:24 +12:00
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
adisbladis c1bbb11c5d Add support for recurseForDerivations
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 = ":";
    };
  };

}
```
2022-04-25 22:11:53 +12:00
adisbladis 813c5d7aae Add test for a job with a nested attrset 2022-04-22 20:36:52 +12:00
adisbladis 0d3e7c2240
Add nixpkgs-fmt + associated checks 2021-09-24 22:18:46 -05:00
Jörg Thalheim 76c3e68ccd
run tests in CI 2021-03-21 19:31:57 +01:00
Jörg Thalheim 71cbe4eab4
output missing/substitutable derivations in eval output 2021-03-21 19:05:11 +01:00