From ccc7601a0e95d8adccf3a4a7db837aa9f1b3b3a6 Mon Sep 17 00:00:00 2001 From: tv Date: Sun, 23 Jul 2017 09:11:14 +0200 Subject: writeJSON: pretty-print output --- krebs/5pkgs/writers.nix | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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 ; }; }; - 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 [ -- cgit v1.2.3