summaryrefslogtreecommitdiffstats
path: root/default.nix
diff options
context:
space:
mode:
authortv <tv@shackspace.de>2015-10-17 07:35:21 +0200
committertv <tv@shackspace.de>2015-10-17 07:35:21 +0200
commitd7f0c3d171eec868a8c13bed2e076c65cbfbaabe (patch)
tree7d4bc2779eddbfe30a1e383d08450e138933bdba /default.nix
parentaa094e2b81910455e2385c78727da13f03074913 (diff)
move maybe to krebs lib
Diffstat (limited to 'default.nix')
-rw-r--r--default.nix10
1 files changed, 2 insertions, 8 deletions
diff --git a/default.nix b/default.nix
index fd127084..841882f5 100644
--- a/default.nix
+++ b/default.nix
@@ -7,6 +7,8 @@ assert current-user-name != "";
let
lib = import <nixpkgs/lib>;
+ klib = import ./krebs/4lib { inherit lib; };
+in with klib; let
nspath = ns: p: ./. + "/${ns}/${p}";
kpath = nspath "krebs";
@@ -67,12 +69,4 @@ let
}.${v} or Nothing)
(builtins.readDir path)));
- # TODO move to lib
- Just = x: { type = "maybe"; value = x; };
- Nothing = { type = "maybe"; };
- isMaybe = x: builtins.typeOf x == "set" && x.type or false == "maybe";
- isJust = x: isMaybe x && builtins.hasAttr "value" x;
- fromJust = x: assert isJust x; x.value;
- catMaybes = xs: map fromJust (builtins.filter isJust xs);
-
in out