summaryrefslogtreecommitdiffstats
path: root/krebs/4lib
diff options
context:
space:
mode:
authortv <tv@shackspace.de>2015-08-28 21:31:59 +0200
committertv <tv@shackspace.de>2015-08-28 21:31:59 +0200
commitc1aaaca7f7febe0c587342ae74e7045bb9a67c5a (patch)
treecadfdb8d3968e7e3dea817bfba255d78a3c9de9c /krebs/4lib
parentf6997378c91be84432703183397f8675143030e9 (diff)
krebs += pkgs.writeC lib.toC
Diffstat (limited to 'krebs/4lib')
-rw-r--r--krebs/4lib/default.nix6
1 files changed, 6 insertions, 0 deletions
diff --git a/krebs/4lib/default.nix b/krebs/4lib/default.nix
index 8b587dfb2..ca7219c7e 100644
--- a/krebs/4lib/default.nix
+++ b/krebs/4lib/default.nix
@@ -16,4 +16,10 @@ builtins // lib // rec {
listset = import ./listset.nix { inherit lib; };
shell = import ./shell.nix { inherit lib; };
tree = import ./tree.nix { inherit lib; };
+
+ toC = x: {
+ list = "{ ${concatStringsSep ", " (map toC x)} }";
+ null = "NULL";
+ string = toJSON x; # close enough
+ }.${typeOf x};
}