diff --git a/default.nix b/default.nix --- a/default.nix +++ b/default.nix @@ -93,21 +93,6 @@ let pythonPackages = self; }; - # Somewhat snappier setup of the development environment - # TODO: move into shell.nix - # TODO: think of supporting a stable path again, so that multiple shells - # can share it. - shellHook = '' - # Set locale - export LC_ALL="en_US.UTF-8" - - tmp_path=$(mktemp -d) - export PATH="$tmp_path/bin:$PATH" - export PYTHONPATH="$tmp_path/${self.python.sitePackages}:$PYTHONPATH" - mkdir -p $tmp_path/${self.python.sitePackages} - python setup.py develop --prefix $tmp_path --allow-hosts "" - ''; - # Add VCSServer bin directory to path so that tests can find 'vcsserver'. preCheck = '' export PATH="$out/bin:$PATH" diff --git a/shell.nix b/shell.nix --- a/shell.nix +++ b/shell.nix @@ -9,10 +9,28 @@ let pkgs; }; + vcs-pythonPackages = vcsserver.pythonPackages; + in vcsserver.override (attrs: { # Avoid that we dump any sources into the store when entering the shell and # make development a little bit more convenient. src = null; + # Somewhat snappier setup of the development environment + # TODO: think of supporting a stable path again, so that multiple shells + # can share it. + postShellHook = '' + # Set locale + export LC_ALL="en_US.UTF-8" + + # Custom prompt to distinguish from other dev envs. + export PS1="\n\[\033[1;32m\][VCS-shell:\w]$\[\033[0m\] " + + tmp_path=$(mktemp -d) + export PATH="$tmp_path/bin:$PATH" + export PYTHONPATH="$tmp_path/${vcs-pythonPackages.python.sitePackages}:$PYTHONPATH" + mkdir -p $tmp_path/${vcs-pythonPackages.python.sitePackages} + python setup.py develop --prefix $tmp_path --allow-hosts "" + ''; })