Hard to get attrs of something having an outPath attribute with --json output format #773

Open
opened 2025-03-26 18:37:57 +00:00 by jade · 0 comments
Owner

Currently the --json output squashes everything that looks like a derivation into its outPath. This is frustrating if you want the attributes.

There should ideally be some way to get the attributes of things, though, note #772 makes this a little tricky: in most practical cases you don't want to evaluate derivation attrs.

Maybe the real solution is something (RPC) better than this....

$ nix eval --expr '{outPath = "meow"; foo = 4;}' --json
"meow"
Currently the `--json` output squashes everything that looks like a derivation into its outPath. This is frustrating if you want the attributes. There should ideally be some way to get the attributes of things, though, note https://git.lix.systems/lix-project/lix/issues/772 makes this a little tricky: in most practical cases you don't *want* to evaluate derivation attrs. Maybe the real solution is something (RPC) better than this.... ``` $ nix eval --expr '{outPath = "meow"; foo = 4;}' --json "meow" ```
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: lix-project/lix#773
No description provided.