summaryrefslogtreecommitdiffstats
path: root/tv/4lib/default.nix
diff options
context:
space:
mode:
authorlassulus <lass@aidsballs.de>2015-07-28 21:49:48 +0200
committerlassulus <lass@aidsballs.de>2015-07-28 21:49:48 +0200
commitce2b97767e201d11ed4d34d8de770eb74da17125 (patch)
treedf2dae28296dfc29ac3a98ad0952cd27f7d382a3 /tv/4lib/default.nix
parent12644fe303a6045d6d8ae75916cb601f95596f25 (diff)
parent3228890813535514dfdfe9d049486a9e6054e479 (diff)
Merge remote-tracking branch 'cd/user-toplevel' into newmaster
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}");
+}