File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -40,3 +40,11 @@ jsonOut="$(nix print-dev-env -f structured-attrs-shell.nix --json)"
40
40
test " $( <<< " $jsonOut" jq ' .structuredAttrs|keys|.[]' -r) " = " $( printf " .attrs.json\n.attrs.sh" ) "
41
41
42
42
test " $( <<< " $jsonOut" jq ' .variables.outputs.value.out' -r) " = " $( <<< " $jsonOut" jq ' .structuredAttrs.".attrs.json"' -r | jq -r ' .outputs.out' ) "
43
+
44
+ # Hacky way of making structured attrs. We should preserve for now for back compat, but also deprecate.
45
+
46
+ hackyExpr=' derivation { name = "a"; system = "foo"; builder = "/bin/sh"; __json = builtins.toJSON { a = 1; }; }'
47
+
48
+ # Check it works with the expected structured attrs
49
+ hacky=$( nix-instantiate --expr " $hackyExpr " )
50
+ nix derivation show " $hacky " | jq --exit-status ' ."' " $hacky " ' ".env.__json | fromjson | . == {"a": 1}'
You can’t perform that action at this time.
0 commit comments