Compare commits
2 Commits
18f60085da
...
427044730d
Author | SHA1 | Date | |
---|---|---|---|
427044730d | |||
756c49865d |
13
home.nix
13
home.nix
|
@ -78,17 +78,24 @@ in rec {
|
||||||
# We put PROMPT in initExtra instead of localVariables.PROMPT because nix puts the string in double quotes, whereas we want single quotes for the command to run each time
|
# We put PROMPT in initExtra instead of localVariables.PROMPT because nix puts the string in double quotes, whereas we want single quotes for the command to run each time
|
||||||
initExtra =
|
initExtra =
|
||||||
''
|
''
|
||||||
|
get_stuff_in_nix() {
|
||||||
|
printf "%s" $PATH | tr ':' '\n' | grep '/nix/store' \
|
||||||
|
| sed -Ee 's|/nix/store/[0-9a-z]*-(.*)/.*|\1|g' \
|
||||||
|
| sed -Ee 's|-[0-9]+(\.[0-9]+)+||g' \
|
||||||
|
| tr '\n' ' '
|
||||||
|
}
|
||||||
export PROMPT='$(
|
export PROMPT='$(
|
||||||
BG=$PROMPT_COLOR
|
BG=$PROMPT_COLOR
|
||||||
FG=0
|
FG=0
|
||||||
if [ ! -z $NIX_BUILD_CORES ] ; then
|
NIX_CONTENT="$(get_stuff_in_nix)"
|
||||||
BG=56
|
if [ ! -z "$NIX_BUILD_CORES" -o ! -z "$NIX_CONTENT" ] ; then
|
||||||
|
BG=91
|
||||||
FG=15
|
FG=15
|
||||||
fi
|
fi
|
||||||
echo -en "%{\033[0m\033[38;5;''${FG}m\033[48;5;''${BG}m%} ";
|
echo -en "%{\033[0m\033[38;5;''${FG}m\033[48;5;''${BG}m%} ";
|
||||||
echo -n "["
|
echo -n "["
|
||||||
${unambig-path}/bin/unambig-path
|
${unambig-path}/bin/unambig-path
|
||||||
echo -en "] %T ";
|
echo -en "] $NIX_CONTENT%T ";
|
||||||
echo -en "%{\033[0m\033[38:5:''${BG}m%}"
|
echo -en "%{\033[0m\033[38:5:''${BG}m%}"
|
||||||
echo -en "%{\033[0m%} ";
|
echo -en "%{\033[0m%} ";
|
||||||
)'
|
)'
|
||||||
|
|
Loading…
Reference in New Issue
Block a user