shell.nix
50 lines
| 1.3 KiB
| text/x-nix
|
NixLexer
r472 | # This file contains the adjustments which are desired for a development | |||
# environment. | ||||
{ pkgs ? (import <nixpkgs> {}) | ||||
r981 | , pythonPackages ? "python37Packages" | |||
r96 | , doCheck ? false | |||
r0 | }: | |||
let | ||||
r96 | ||||
r981 | # Full runtime environment without the actual Python package | |||
env = import ./default.nix { | ||||
r472 | inherit | |||
doCheck; | ||||
r981 | pythonExternalOverrides = self: super: { | |||
rhodecode-vcsserver = null; | ||||
}; | ||||
r34 | }; | |||
r0 | ||||
r981 | # The python package with full runtime environment as dependency for nix-shell | |||
package = (import ./default.nix { | ||||
inherit | ||||
doCheck; | ||||
pythonExternalOverrides = self: super: { | ||||
rhodecode-vcsserver = super.rhodecode-vcsserver.overridePythonAttrs(attrs: { | ||||
nativeBuildInputs = with self; | ||||
attrs.nativeBuildInputs ++ | ||||
attrs.buildInputs ++ | ||||
attrs.propagatedBuildInputs ++ [ | ||||
env | ||||
pytest | ||||
ipdb | ||||
ipython | ||||
]; | ||||
}); | ||||
}; | ||||
}).passthru.pythonPackages.rhodecode-vcsserver; | ||||
r96 | ||||
r981 | in package.overridePythonAttrs(attrs: { | |||
postShellHook= '' | ||||
Martin Bornhold
|
r95 | # Custom prompt to distinguish from other dev envs. | ||
r970 | export PS1="\n\[\033[1;32m\][vcsserver-shell:\w]$\[\033[0m\] " | |||
Martin Bornhold
|
r95 | |||
r472 | # Set locale | |||
r970 | export LOCALE_ARCHIVE="${pkgs.glibcLocales}/lib/locale/locale-archive" | |||
r472 | export LC_ALL="en_US.UTF-8" | |||
''; | ||||
r0 | }) | |||