diff --git a/default.nix b/default.nix --- a/default.nix +++ b/default.nix @@ -156,18 +156,6 @@ let then "${pkgs.glibcLocales}/lib/locale/locale-archive" else ""; - # 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 = '' - 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 "" - '' + linkNodeAndBowerPackages; - preCheck = '' export PATH="$out/bin:$PATH" ''; diff --git a/shell.nix b/shell.nix --- a/shell.nix +++ b/shell.nix @@ -27,13 +27,13 @@ let hasVcsserver = !isNull vcsserver; - enterprise = import ./default.nix { + enterprise-ce = import ./default.nix { inherit pkgs doCheck; }; - pythonPackages = enterprise.pythonPackages; + ce-pythonPackages = enterprise-ce.pythonPackages; -in enterprise.override (attrs: { +in enterprise-ce.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; @@ -41,17 +41,30 @@ in enterprise.override (attrs: { buildInputs = attrs.buildInputs ++ pkgs.lib.optionals (hasVcsserver) vcsserver.propagatedNativeBuildInputs ++ - (with pythonPackages; [ + (with ce-pythonPackages; [ bumpversion invoke ipdb ]); - shellHook = attrs.shellHook + + # Somewhat snappier setup of the development environment + # TODO: think of supporting a stable path again, so that multiple shells + # can share it. + postShellHook = '' + # Custom prompt to distinguish from other dev envs. + export PS1="\n\[\033[1;32m\][CE-shell:\w]$\[\033[0m\] " + + tmp_path=$(mktemp -d) + export PATH="$tmp_path/bin:$PATH" + export PYTHONPATH="$tmp_path/${ce-pythonPackages.python.sitePackages}:$PYTHONPATH" + mkdir -p $tmp_path/${ce-pythonPackages.python.sitePackages} + python setup.py develop --prefix $tmp_path --allow-hosts "" + '' + enterprise-ce.linkNodeAndBowerPackages + pkgs.lib.strings.optionalString (hasVcsserver) '' # Setup the vcsserver development egg. pushd ${vcsserverAbsPath} python setup.py develop --prefix $tmp_path --allow-hosts "" popd ''; + })