ccd8e800df
* hacking at dns * hack * hax * start dics! * hacking * feat: docs! --------- Co-authored-by: Truxnell <9149206+truxnell@users.noreply.github.com>
1.1 KiB
1.1 KiB
Message of the day
Why not include a nice message of the day for each server I log into?
The below gives some insight into what the servers running, status of zpools, usage, etc.
While not show below - thankfully - If a zpool error is found the status gives a full zpool status -x
debrief which is particulary eye-catching upon login.
Code TLDR
:simple-github:/nixos/modules/nixos/system/motd
Write a shell script using nix with a bash motd
let
motd = pkgs.writeShellScriptBin "motd"
''
#! /usr/bin/env bash
source /etc/os-release
service_status=$(systemctl list-units | grep podman-)
<- SNIP ->
printf "$BOLDService status$ENDCOLOR\n"
'';
in
This gets us a shells script we can then directly call into systemPackages - and after that its just a short hop to make this part of the shell init.
!!! note
Replace with your preferred shell!
environment.systemPackages = [
motd
];
programs.fish.interactiveShellInit = ''
motd
'';