From 4dddc69f4746c751020d76a031b343735f16c761 Mon Sep 17 00:00:00 2001 From: coolneng Date: Thu, 11 Feb 2021 05:06:24 +0100 Subject: [PATCH] Add MOTD that summarizes the system current status --- configuration.nix | 3 +++ scripts/motd.sh | 45 +++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 48 insertions(+) create mode 100755 scripts/motd.sh diff --git a/configuration.nix b/configuration.nix index d90d84e..8f5c6c5 100644 --- a/configuration.nix +++ b/configuration.nix @@ -101,6 +101,9 @@ # Increase inotify limits boot.kernel.sysctl = { "fs.inotify.max_user_watches" = 204800; }; + # MOTD message + programs.fish.interactiveShellInit = "${./scripts/motd.sh}"; + # Import other configuration modules imports = [ ./modules/hardware-configuration.nix diff --git a/scripts/motd.sh b/scripts/motd.sh new file mode 100755 index 0000000..a549f62 --- /dev/null +++ b/scripts/motd.sh @@ -0,0 +1,45 @@ +#!/run/current-system/sw/bin/bash + +# Kernel information +LINUX=$(uname -rs | cut -d " " -f2) + +# System uptime +uptime=$(cut -f1 -d.