I have a server with zsh as shell which I login as root to over ssh. I want to customise the PROMPT variable. This server does not have home manager and I want to keep it that way so it is lean.
Which ends up in /etc/zshrc.
I have proved zsh is loading /etc/zshrc with an echo in interactiveShellInit block. However the PROMPT var (echo $PROMPT) is still set to “%n@%m:%~/ >” which i assume is the default.
My current work around is to manually create the /root/.zshrc file with the PROMPT variable in it, as per below and that does work.
system.activationScripts = {
# Have to create .zshrc here as zsh.interactiveShellInit did not work
zshrc = {
text = ''
echo -e "PROMPT='%B%F{red}[%n@%m:%1d]$ %f%b'" > /root/.zshrc
'';
};
};