fedimint
fedimint copied to clipboard
Added how to double check that nix develop worked
Codecov Report
Merging #453 (6a85f50) into master (10398d5) will not change coverage. The diff coverage is
n/a
.
@@ Coverage Diff @@
## master #453 +/- ##
=======================================
Coverage 74.54% 74.54%
=======================================
Files 83 83
Lines 10550 10550
=======================================
Hits 7865 7865
Misses 2685 2685
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.
Nice :) Was just talking with @dpc about this. He suggested altering PS1 in bashrc (or other) like this:
set -l nix_shell_info (
if test -n "$IN_NIX_SHELL"
echo -n "{NS} "
end
)
echo -n -s "$nix_shell_info"
maybe this could be added to the readme
Nice :) Was just talking with @dpc about this. He suggested altering PS1 in bashrc (or other) like this:
set -l nix_shell_info ( if test -n "$IN_NIX_SHELL" echo -n "{NS} " fi ) echo -n -s "$nix_shell_info"
maybe this could be added to the readme
(thats his settup not a copy and paste solution (I just noticed))
Also, gotta rebase now.
@NicolaLS For bash something like:
export PS1="$(test -n "$IN_NIX_SHELL" && echo "NX") $PS1"
should do. It can be added to ~/.bashrc
at the bottom.
@dpc noticed this didnt really work for me I ended up doing something like:
if [[ -z $IN_NIX_SHELL ]]; then
export PS1="nix-dev $PS1";
fi
@matthiasdebernardini maybe check if you want to change to this
@dpc noticed this didnt really work for me I ended up doing something like:
if [[ -z $IN_NIX_SHELL ]]; then export PS1="nix-dev $PS1"; fi
@matthiasdebernardini maybe check if you want to change to this
Sorry just noticed this dosn't work either. Your ps1 will not revert back to normal..I'll post something else
Ok finally:
function set_custom_prompt {
#added on Aug. 23 to know when in nix develop
if [[ "$IN_NIX_SHELL" = "impure" ]]; then
export PS1="nix-dev";
else
export PS1="λ \W "; #put your default ps1 here
fi
}
PROMPT_COMMAND='set_custom_prompt'
This also resets the PS1. Since this his so highly custom idk if this should go in the readme but wanted to correct my previous comment which was wrong. @matthiasdebernardini