Jq cannot parse users-groups.json

Just having deep dive into the weeds of nix/OS and do some learning.

Seems

https://github.com/NixOS/nixpkgs/blob/af5b6f9ffdb8fd89776b110cfcd145932a2a8439/nixos/modules/config/users-groups.nix

writes it’s results to a json file

 spec = pkgs.writeText "users-groups.json" (builtins.toJSON {

trying to parse this output with jq fails with

jq: error: syntax error, unexpected IDENT, expecting $end (Unix shell quoting issues?) at , line 1:
834saalk8s897bznwk8qm93l5lcqhyn3-users-groups.json
jq: 1 compile error

i presume that the json that builtins.toJSON is not exactly what jq likes?

What’s your jq command like? It sounds like you are trying to execute the file name as a jq expression.

Can you try this?

jq < that-file.json
1 Like