diff options
author | tv <tv@krebsco.de> | 2017-07-23 09:11:14 +0200 |
---|---|---|
committer | lassulus <lassulus@lassul.us> | 2017-07-23 21:19:14 +0200 |
commit | 35b70145acc5d8980be863de1f1857609e82374e (patch) | |
tree | 138a8fd99af26cce61274f54c120372d0813b8ec | |
parent | 9c95a5b2321cf0fe08822419d04f2e6c7164714f (diff) |
writeJSON: pretty-print output
-rw-r--r-- | krebs/5pkgs/writers.nix | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/krebs/5pkgs/writers.nix b/krebs/5pkgs/writers.nix index c4fb8cd83..49ca3557e 100644 --- a/krebs/5pkgs/writers.nix +++ b/krebs/5pkgs/writers.nix @@ -262,7 +262,12 @@ with import <stockholm/lib>; }; }; - writeJSON = name: value: pkgs.writeText name (toJSON value); + writeJSON = name: value: pkgs.runCommand name { + json = toJSON value; + passAsFile = [ "json" ]; + } /* sh */ '' + ${pkgs.jq}/bin/jq . "$jsonPath" > "$out" + ''; writeNixFromCabal = trace (toString [ |