Closed mmontin closed 1 year ago
Yes, that's possible using something like
nixConfig.bash-prompt-suffix = "Now you are in the devshell ";
in the flake.
I'd advocate towards not using this parameter in the flake because it is intrusive. Some people have their own prompt configuration and do not want the flake to mess with it.
I think you can edit your nix.conf
file to change your prompt upon entering a nix develop environment https://nixos.org/manual/nix/stable/command-ref/new-cli/nix3-develop.html#description (and furthermore, this will work for all flakes, not only the one with the option activated.
I'd advocate towards not using this parameter in the flake because it is intrusive.
Exactly the same; it's usually not appreciated to force a prompt upon people. Basically anything that a flake does through nixConfig.
you should be careful because it can mess up with the user's configuration. That also means a user can achieve the same effect for themselves easily, which will also lead to more consistency when working on different Nix projects. For instance, my prompt always shows me Nix environments automatically:
I do understand this concern, although each and every client project we handle makes it fairly explicit when entering the nix env. In our old cooked conf, if was pretty visible as well when entering a nix-shell
. So why do all clients do that if that's bad practice (it's a genuine question)?
It was visible in the old configuration because nix-shell
was used, which changed the prompt by default, if I'm correct.
For your second question, I think it's a matter of mindset, perhaps local culture, and mostly awareness.
Thanks, you've convinced me it was not needed by default, and @florentc helped me in having a custom prompt to showcase it.
Could we have a specific prompt withing our
nix develop
environment? Would make it easier to see whether we're in or out of it.