Thanks! sourcing it in .profile
file was indeed a great option.
but it’s not very straight foward, thought.
When we run nix-shell
we spawn a new shell instead of sourcing the env to the current one.
So my solution was to use direnv ( Nix · direnv/direnv Wiki · GitHub )
so I added this to my .profile
(
cd /path/to/project;
direnv export bash > /tmp/startup-shell
)
source /tmp/startup-shell
one caveat is that direnv
does not support alias definitions. But those are fine to just add to the .bashrc
file.