NixOS: cấu hình file .bashrc - QuânSysAd's Blog

14 tháng 12 2021

NixOS: cấu hình file .bashrc

 Khi mới dùng NixOS bạn thường ko biết cấu hình .bashrc ở đâu. Hãy cấu hình như sau ở file /etc/nixos/configuration.nix


programs.bash.promptInit = ''
set_prompt () {
if [[ "$?" == 0 ]]; then
PS1=""
else
PS1="\[\e[01;31m\]($?) "
fi
PS1+="[\u@\h \W]\\$ "
}
export HISTCONTROL=ignoredups:erasedups
export HISTSIZE=10000
export HISTFILESIZE=100000
shopt -s histappend
export PROMPT_COMMAND="set_prompt; history -a; history -c; history -r;"

export PATH=~/.npm-packages/bin:$PATH
export NODE_PATH=~/.npm-packages/lib/node_modules

'';

Không có nhận xét nào: