about summary refs log tree commit diff
path: root/util.nix
diff options
context:
space:
mode:
Diffstat (limited to 'util.nix')
-rw-r--r--util.nix13
1 files changed, 11 insertions, 2 deletions
diff --git a/util.nix b/util.nix
index 86fe375..1375ef5 100644
--- a/util.nix
+++ b/util.nix
@@ -1,5 +1,14 @@
+{ lib }:
 {
-  mkMe = { name ? "", ... }@me: 
+  checkMe = { name ? "", ... }@me:
     assert name != "";
+    assert (builtins.pathExists ./machines/${name}.nix)
+      && (builtins.pathExists ./hardware/${name}.nix);
     me;
-}
\ No newline at end of file
+
+  titleCase = str: with lib.strings; let
+    firstCharUpper = s: concatStrings [(toUpper (substring 0 1 s)) (substring 1 (stringLength s) s)];
+  in
+    concatStringsSep " " (map firstCharUpper (splitString " " str));
+    
+}