summaryrefslogtreecommitdiffstats
path: root/krebs/5pkgs/builders.nix
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2016-07-03 20:46:48 +0200
committertv <tv@krebsco.de>2016-07-03 20:46:48 +0200
commit3d0f7724cc102c8ba5a1811e62d4a39eb8be2e41 (patch)
tree24c0416a753c8088a9f5bb2f6853df64c5dc14bb /krebs/5pkgs/builders.nix
parent7f0ea39a978fb02b4b165e82051f83273093a94c (diff)
writeJq: init
Diffstat (limited to 'krebs/5pkgs/builders.nix')
-rw-r--r--krebs/5pkgs/builders.nix11
1 files changed, 11 insertions, 0 deletions
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"