summaryrefslogtreecommitdiffstats
path: root/tv/4lib/default.nix
diff options
context:
space:
mode:
authormakefu <github@syntax-fehler.de>2015-07-28 21:56:10 +0200
committermakefu <github@syntax-fehler.de>2015-07-28 21:56:10 +0200
commitf7e206b608a2844c4e81173a673369402f8da06b (patch)
tree109f929d89dfa7a4a1b686019494b2355bcbc81f /tv/4lib/default.nix
parentfca517dd0e61c67d2a485f578e7146b46f048f69 (diff)
parent3228890813535514dfdfe9d049486a9e6054e479 (diff)
Merge remote-tracking branch 'cd/user-toplevel' into user-toplevel
Diffstat (limited to 'tv/4lib/default.nix')
-rw-r--r--tv/4lib/default.nix27
1 files changed, 27 insertions, 0 deletions
diff --git a/tv/4lib/default.nix b/tv/4lib/default.nix
new file mode 100644
index 000000000..e0a295f17
--- /dev/null
+++ b/tv/4lib/default.nix
@@ -0,0 +1,27 @@
+{ lib, pkgs, ... }:
+
+let
+ krebs = import ../../4lib/krebs { inherit lib; };
+in
+
+with krebs;
+
+krebs // rec {
+
+ git = import ./git.nix {
+ lib = krebs;
+ inherit pkgs;
+ };
+
+ # "7.4.335" -> "74"
+ majmin = with lib; x : concatStrings (take 2 (splitString "." x));
+
+ shell-escape =
+ let
+ isSafeChar = c: match "[-./0-9_a-zA-Z]" c != null;
+ in
+ stringAsChars (c:
+ if isSafeChar c then c
+ else if c == "\n" then "'\n'"
+ else "\\${c}");
+}