aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--configuration.nix21
-rw-r--r--me.nix4
-rw-r--r--util.nix13
3 files changed, 30 insertions, 8 deletions
diff --git a/configuration.nix b/configuration.nix
index 81df308..bf8b46c 100644
--- a/configuration.nix
+++ b/configuration.nix
@@ -1,9 +1,9 @@
-{ pkgs, ... }:
+{ pkgs, lib, ... }:
let
- util = import ./util.nix;
+ util = import ./util.nix { inherit lib; };
- me = import ./me.nix { inherit util; };
+ me = util.checkMe (import ./me.nix);
security = import ./security.nix;
in
{
@@ -33,6 +33,14 @@ in
hashedPassword = security.password;
};
+ users.motd = ''
+
+/^ /^
+\ ' ' 7 < Hi, I'm ${util.titleCase me.name}
+/ \
+
+ '';
+
networking = {
hostName = me.name;
@@ -85,7 +93,12 @@ in
vimrcFile = ./configs/.vimrc;
};
};
- fish.enable = true;
+ fish = {
+ enable = true;
+ interactiveShellInit = ''
+ set fish_greeting
+ '';
+ };
git.enable = true;
tmux.enable = true;
};
diff --git a/me.nix b/me.nix
index 7f088d3..e4e8cfa 100644
--- a/me.nix
+++ b/me.nix
@@ -1,3 +1,3 @@
-{ util, ... }: util.mkMe {
+{
name = ""; # Enter machine name here
-} \ No newline at end of file
+}
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));
+
+}