summaryrefslogtreecommitdiffstats
path: root/krebs/4lib/default.nix
diff options
context:
space:
mode:
authormakefu <github@syntax-fehler.de>2015-10-16 23:21:19 +0200
committermakefu <github@syntax-fehler.de>2015-10-16 23:21:19 +0200
commit9da82f7bc6341207fe07a35335bd877a799b4f56 (patch)
treef070749ac24742ffa2b47484adb0ab8ad0431d81 /krebs/4lib/default.nix
parent4d7bb2475f13730f238e854783b81b7609cfdcba (diff)
parent4c6635f2c1e6b046155009afb455e4458e196100 (diff)
Merge remote-tracking branch 'cd/master'
Diffstat (limited to 'krebs/4lib/default.nix')
-rw-r--r--krebs/4lib/default.nix6
1 files changed, 6 insertions, 0 deletions
diff --git a/krebs/4lib/default.nix b/krebs/4lib/default.nix
index ca7219c7e..78f719988 100644
--- a/krebs/4lib/default.nix
+++ b/krebs/4lib/default.nix
@@ -5,6 +5,8 @@ with lib;
builtins // lib // rec {
+ eq = x: y: x == y;
+
addName = name: set:
set // { inherit name; };
@@ -22,4 +24,8 @@ builtins // lib // rec {
null = "NULL";
string = toJSON x; # close enough
}.${typeOf x};
+
+ subdirsOf = path:
+ mapAttrs (name: _: path + "/${name}")
+ (filterAttrs (_: eq "directory") (readDir path));
}