##// END OF EJS Templates
release: Finish preparation for 4.10.3
release: Finish preparation for 4.10.3

File last commit:

r1133:69363678 default
r2239:68baee10 v4.10.3 stable
Show More
shell.nix
83 lines | 3.0 KiB | text/x-nix | NixLexer
project: added all source files and assets
r1 { pkgs ? (import <nixpkgs> {})
Martin Bornhold
nix: Use vcsserver from config instead of using command line argument.
r1132 , pythonPackages ? "python27Packages"
project: added all source files and assets
r1 , doCheck ? true
Martin Bornhold
nix: Add `sourcesOverrides` argument to shell.nix to set the vcs server path in jenkins.
r1133 , sourcesOverrides ? {}
Martin Bornhold
nix: Use vcsserver from config instead of using command line argument.
r1132 , doDevelopInstall ? true
project: added all source files and assets
r1 }:
let
Martin Bornhold
nix: Add `sourcesOverrides` argument to shell.nix to set the vcs server path in jenkins.
r1133 # Get sources from config and update them with overrides.
sources = (pkgs.config.rc.sources or {}) // sourcesOverrides;
project: added all source files and assets
r1
Martin Bornhold
nix: Move shell hook: default.nix -> shell.nix and set custom prompt....
r1130 enterprise-ce = import ./default.nix {
Martin Bornhold
nix: Use vcsserver from config instead of using command line argument.
r1132 inherit pkgs pythonPackages doCheck;
project: added all source files and assets
r1 };
Martin Bornhold
nix: Move shell hook: default.nix -> shell.nix and set custom prompt....
r1130 ce-pythonPackages = enterprise-ce.pythonPackages;
project: added all source files and assets
r1
Martin Bornhold
nix: Add methods to support develop installations from config.
r1131 # This method looks up a path from `pkgs.config.rc.sources` and returns a
# shell script which does a `python setup.py develop` installation of it. If
# no path is found it will return an empty string.
optionalDevelopInstall = attributeName:
let
path = pkgs.lib.attrByPath [attributeName] null sources;
doIt = doDevelopInstall && path != null;
in
pkgs.lib.optionalString doIt (
builtins.trace "Develop install of ${attributeName} from ${path}" ''
echo "Develop install of '${attributeName}' from '${path}' [BEGIN]"
pushd ${path}
python setup.py develop --prefix $tmp_path --allow-hosts ""
popd
echo "Develop install of '${attributeName}' from '${path}' [DONE]"
'');
# This method looks up a path from `pkgs.config.rc.sources` and imports the
# default.nix file if it exists. It returns the list of build inputs. If no
# path is found it will return an empty list.
optionalDevelopInstallBuildInputs = attributeName:
let
path = pkgs.lib.attrByPath [attributeName] null sources;
nixFile = "${path}/default.nix";
doIt = doDevelopInstall && path != null && pkgs.lib.pathExists "${nixFile}";
derivate = import "${nixFile}" {
inherit doCheck pkgs pythonPackages;
};
in
pkgs.lib.lists.optionals doIt derivate.propagatedNativeBuildInputs;
developInstalls = [ "rhodecode-vcsserver" ];
Martin Bornhold
nix: Move shell hook: default.nix -> shell.nix and set custom prompt....
r1130 in enterprise-ce.override (attrs: {
project: added all source files and assets
r1 # Avoid that we dump any sources into the store when entering the shell and
# make development a little bit more convenient.
src = null;
Martin Bornhold
dev-env: Improve build inputs formatting.
r433 buildInputs =
attrs.buildInputs ++
Martin Bornhold
nix: Use vcsserver from config instead of using command line argument.
r1132 pkgs.lib.lists.concatMap optionalDevelopInstallBuildInputs developInstalls ++
Martin Bornhold
nix: Move shell hook: default.nix -> shell.nix and set custom prompt....
r1130 (with ce-pythonPackages; [
Martin Bornhold
dev-env: Improve build inputs formatting.
r433 bumpversion
invoke
ipdb
]);
project: added all source files and assets
r1
Martin Bornhold
nix: Move shell hook: default.nix -> shell.nix and set custom prompt....
r1130 # Somewhat snappier setup of the development environment
# TODO: think of supporting a stable path again, so that multiple shells
# can share it.
Martin Bornhold
nix: Use vcsserver from config instead of using command line argument.
r1132 preShellHook = enterprise-ce.linkNodeAndBowerPackages + ''
Martin Bornhold
nix: Move shell hook: default.nix -> shell.nix and set custom prompt....
r1130 # Custom prompt to distinguish from other dev envs.
export PS1="\n\[\033[1;32m\][CE-shell:\w]$\[\033[0m\] "
Martin Bornhold
nix: Use vcsserver from config instead of using command line argument.
r1132 # Setup a temporary directory.
Martin Bornhold
nix: Move shell hook: default.nix -> shell.nix and set custom prompt....
r1130 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}
Martin Bornhold
nix: Use vcsserver from config instead of using command line argument.
r1132
# Develop installations
Martin Bornhold
nix: Move shell hook: default.nix -> shell.nix and set custom prompt....
r1130 python setup.py develop --prefix $tmp_path --allow-hosts ""
Martin Bornhold
nix: Use vcsserver from config instead of using command line argument.
r1132 echo "Additional develop installs"
'' + pkgs.lib.strings.concatMapStrings optionalDevelopInstall developInstalls;
Martin Bornhold
nix: Move shell hook: default.nix -> shell.nix and set custom prompt....
r1130
project: added all source files and assets
r1 })