nix-community / nix-eval-jobs

Parallel nix evaluator with a streamable json output [maintainers @Mic92, @adisbladis]
GNU General Public License v3.0
154 stars 30 forks source link

`passthru` attributes are evaluated like normal attributes #198

Open jsoo1 opened 1 year ago

jsoo1 commented 1 year ago

I have a few build products that we make like this:

let res = nixos { ... }; in
res.system.overrideAttrs (o: { passthru = (o.passthru or { }) // res; })

Which results in errors like this with nix-eval-jobs

error: value is a set while a string was expected

       at /nix/store/.../nixos/default.nix:38:3:

           37|
           38|   system = eval.config.system.build.toplevel;
             |   ^
           39|

But nix-instantiate handles this fine.

Does nix-eval-jobs need to skip passthru attrs?

Mic92 commented 1 year ago

Can you make this a complete example that evaluates?

╭─[/tmp/tmp.lit6ZL6FZb]
╰─ % nix-instantiate foo.nix
error: attribute 'system' missing

       at /tmp/tmp.lit6ZL6FZb/foo.nix:4:4:

            3| let res = nixos { };
            4| in res.system.overrideAttrs (o: { passthru = (o.passthru or { }) // res; })
             |    ^
            5|