diff options
author | tv <tv@shackspace.de> | 2015-07-16 23:22:30 +0200 |
---|---|---|
committer | tv <tv@shackspace.de> | 2015-07-16 23:22:30 +0200 |
commit | 57c520b722f25f384301118046bf9cf182d4edd7 (patch) | |
tree | 57983c04bb49fe0375300861111a61cede545794 /old/lib/default.nix | |
parent | 447c63edbd403abf026800d10594ed037b4304e9 (diff) |
Goodbye old world, and thanks for all the fish!
Diffstat (limited to 'old/lib/default.nix')
-rw-r--r-- | old/lib/default.nix | 62 |
1 files changed, 0 insertions, 62 deletions
diff --git a/old/lib/default.nix b/old/lib/default.nix deleted file mode 100644 index 164a6a1aa..000000000 --- a/old/lib/default.nix +++ /dev/null @@ -1,62 +0,0 @@ -{ lib, pkgs, ... }: - -with builtins; - -let - inherit (lib) mapAttrs stringAsChars; -in - -rec { - git = import ./git.nix { - lib = lib // { - inherit addNames; - }; - inherit pkgs; - }; - - addName = name: set: - set // { inherit name; }; - - addNames = mapAttrs addName; - - - # "7.4.335" -> "74" - majmin = with lib; x : concatStrings (take 2 (splitString "." x)); - - - concat = xs : - if xs == [] - then "" - else head xs + concat (tail xs) - ; - - flip = f : x : y : f y x; - - # isSuffixOf :: String -> String -> Bool - isSuffixOf = - s : xs : - let - sn = stringLength s; - xsn = stringLength xs; - in - xsn >= sn && substring (xsn - sn) sn xs == s ; - - removeSuffix = - s : xs : substring 0 (stringLength xs - stringLength s) xs; - - # setMap :: (String -> a -> b) -> Set String a -> [b] - #setMap = f: xs: map (k : f k (getAttr k xs)) (attrNames xs); - - # setToList :: Set k a -> [a] - #setToList = setMap (_: v: v); - - 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}"); - -} |