feat(console): Add motd with system info
This commit is contained in:
parent
2cb6c24535
commit
e0cec882d8
1 changed files with 31 additions and 19 deletions
|
@ -36,7 +36,37 @@ in
|
|||
|
||||
environment.variables.EDITOR = "nvim";
|
||||
|
||||
programs.neovim.vimAlias = true;
|
||||
programs = {
|
||||
neovim.vimAlias = true;
|
||||
rust-motd = {
|
||||
enable = true;
|
||||
|
||||
settings = {
|
||||
uptime.prefix = "Up";
|
||||
filesystems.root = "/";
|
||||
memory.swap_pos = "below";
|
||||
last_login.root = 5;
|
||||
};
|
||||
};
|
||||
|
||||
bash.promptInit = ''
|
||||
FQDN="$(hostname).$(domainname)"
|
||||
# Provide a nice prompt if the terminal supports it.
|
||||
if [ "$TERM" != "dumb" ] || [ -n "$INSIDE_EMACS" ]; then
|
||||
PROMPT_COLOR="1;31m"
|
||||
((UID)) && PROMPT_COLOR="1;32m"
|
||||
if [ -n "$INSIDE_EMACS" ] || [ "$TERM" = "eterm" ] || [ "$TERM" = "eterm-color" ]; then
|
||||
# Emacs term mode doesn't support xterm title escape sequence (\e]0;)
|
||||
PS1="\n\[\033[$PROMPT_COLOR\][\u@$FQDN:\w]\\$\[\033[0m\] "
|
||||
else
|
||||
PS1="\n\[\033[$PROMPT_COLOR\][\[\e]0;\u@\H: \w\a\]\u@$FQDN:\w]\\$\[\033[0m\] "
|
||||
fi
|
||||
if test "$TERM" = "xterm"; then
|
||||
PS1="\[\033]2;$FQDN:\u:\w\007\]$PS1"
|
||||
fi
|
||||
fi
|
||||
'';
|
||||
};
|
||||
|
||||
system.activationScripts.diff = {
|
||||
supportsDryActivation = true;
|
||||
|
@ -45,24 +75,6 @@ in
|
|||
'';
|
||||
};
|
||||
|
||||
programs.bash.promptInit = ''
|
||||
FQDN="$(hostname).$(domainname)"
|
||||
# Provide a nice prompt if the terminal supports it.
|
||||
if [ "$TERM" != "dumb" ] || [ -n "$INSIDE_EMACS" ]; then
|
||||
PROMPT_COLOR="1;31m"
|
||||
((UID)) && PROMPT_COLOR="1;32m"
|
||||
if [ -n "$INSIDE_EMACS" ] || [ "$TERM" = "eterm" ] || [ "$TERM" = "eterm-color" ]; then
|
||||
# Emacs term mode doesn't support xterm title escape sequence (\e]0;)
|
||||
PS1="\n\[\033[$PROMPT_COLOR\][\u@$FQDN:\w]\\$\[\033[0m\] "
|
||||
else
|
||||
PS1="\n\[\033[$PROMPT_COLOR\][\[\e]0;\u@\H: \w\a\]\u@$FQDN:\w]\\$\[\033[0m\] "
|
||||
fi
|
||||
if test "$TERM" = "xterm"; then
|
||||
PS1="\[\033]2;$FQDN:\u:\w\007\]$PS1"
|
||||
fi
|
||||
fi
|
||||
'';
|
||||
|
||||
hardware.enableRedistributableFirmware = true;
|
||||
|
||||
environment.systemPackages =
|
||||
|
|
Loading…
Reference in a new issue