From 3d0f7724cc102c8ba5a1811e62d4a39eb8be2e41 Mon Sep 17 00:00:00 2001 From: tv Date: Sun, 3 Jul 2016 20:46:48 +0200 Subject: writeJq: init --- krebs/5pkgs/builders.nix | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/krebs/5pkgs/builders.nix b/krebs/5pkgs/builders.nix index dcd49fc10..da7052f38 100644 --- a/krebs/5pkgs/builders.nix +++ b/krebs/5pkgs/builders.nix @@ -231,6 +231,17 @@ rec { ''; }; + writeJq = name: src: pkgs.runCommand name {} /* sh */ '' + name=${assert types.filename.check name; name} + src=${shell.escape src} + + # syntax check + printf '%s' "$src" > src.jq + ${pkgs.jq}/bin/jq -f src.jq < /dev/null + + cp src.jq "$out" + ''; + writeNixFromCabal = trace (toString [ "The function `writeNixFromCabal` has been deprecated in favour of" -- cgit v1.2.3