summaryrefslogtreecommitdiffstats
path: root/krebs/4lib
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2016-06-13 01:23:44 +0200
committertv <tv@krebsco.de>2016-06-13 01:23:44 +0200
commit2adb41310c16c43546a6855a1f6dbcc1c96dc344 (patch)
tree8dad62d6f0d0431b22f6eb36fd113ef160c04e21 /krebs/4lib
parent3c61d227cf189967071501fa73b27697fc2d63a5 (diff)
lib.lpad: init
Diffstat (limited to 'krebs/4lib')
-rw-r--r--krebs/4lib/default.nix5
1 files changed, 5 insertions, 0 deletions
diff --git a/krebs/4lib/default.nix b/krebs/4lib/default.nix
index da936fad6..09d416d44 100644
--- a/krebs/4lib/default.nix
+++ b/krebs/4lib/default.nix
@@ -37,6 +37,11 @@ let out = rec {
shell = import ./shell.nix { inherit lib; };
tree = import ./tree.nix { inherit lib; };
+ lpad = n: c: s:
+ if stringLength s < n
+ then lpad n c (c + s)
+ else s;
+
toC = x: let
type = typeOf x;
reject = throw "cannot convert ${type}";