diff options
| author | Mel <einebeere@gmail.com> | 2024-03-02 18:47:17 +0000 |
|---|---|---|
| committer | Mel <einebeere@gmail.com> | 2024-03-02 18:47:17 +0000 |
| commit | b76ad56fc98a03514fa897de6ed72d97a3f7b465 (patch) | |
| tree | b49050b1d2a2f2f0aaf26d47be5ad8ef6bb9420d /util.nix | |
| parent | 4e29b3423a1c56ba665c66124994178aae58d0d1 (diff) | |
| download | rnrd-b76ad56fc98a03514fa897de6ed72d97a3f7b465.tar.zst rnrd-b76ad56fc98a03514fa897de6ed72d97a3f7b465.zip | |
MOTD on SSH login
Diffstat (limited to 'util.nix')
| -rw-r--r-- | util.nix | 13 |
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)); + +} |
