Skip to content
This repository has been archived by the owner on Oct 1, 2024. It is now read-only.

Commit

Permalink
Merge pull request #462 from BlueBrain/servus-update
Browse files Browse the repository at this point in the history
Modernize the sourcethis
  • Loading branch information
adevress authored Oct 11, 2017
2 parents e6c9643 + ea4585d commit 247ebb7
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 13 deletions.
4 changes: 2 additions & 2 deletions bbp/viz/servus/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ stdenv.mkDerivation rec {

src = fetchgit {
url = "https://github.com/HBPVIS/Servus.git";
rev = "8d47578a7b738432f294b12af80aa9c9d9080df0";
sha256 = "033f2jjkfzaw66nafhgyf1qry8bjbsk3f4plzkhrdhv7hf6kgb18";
rev = "2e9a23aa32c2fc3f5c517405b0ac6292cd09abdf";
sha256 = "0w9ahjghs3p1yb8svzvpk2izzssigqjkcfhdxfhmzknclgv54qs6";
};


Expand Down
51 changes: 40 additions & 11 deletions sourcethis.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,52 @@

export NIXPKG_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd -P )"

# setup SSH for gerrit access

if [[ "${NIX_PATH}" != *"ssh-config-file"* ]]; then
export NIX_PATH="ssh-config-file=$HOME/.ssh/config:$NIX_PATH"
fi

function LocalMachineSSHSetup {

# setup SSH agent forwarding
if [[ "${SSH_AUTH_SOCK}x" != "x" ]]; then
export NIX_PATH="ssh-auth-sock=${SSH_AUTH_SOCK}:${NIX_PATH}"
fi
# setup SSH for gerrit access
if [[ "${NIX_PATH}" != *"ssh-config-file"* ]]; then
export NIX_PATH="ssh-config-file=$HOME/.ssh/config:$NIX_PATH"
fi


# setup SSH agent forwarding
if [[ "${SSH_AUTH_SOCK}x" != "x" ]]; then
export NIX_PATH="ssh-auth-sock=${SSH_AUTH_SOCK}:${NIX_PATH}"
fi
}


function vizClusterSSHSetup {

# setup SSH for git access on viz cluster at BBP
echo "Enable BBP viz cluster configuration"

export NIX_PATH="ssh-config-file=/etc/nix/ssh/config:$NIX_PATH"

# and setup the BBP nixpkgs"
export NIX_PATH="BBPpkgs=${NIXPKG_DIR}:${NIX_PATH}"
}

function BBPnixpkgsSetup {
# and setup the BBP nixpkgs"
export NIX_PATH="BBPpkgs=${NIXPKG_DIR}:${NIX_PATH}"

}



BBPnixpkgsSetup

if [[ "$(hostname)" == *viz* ]]; then
vizClusterSSHSetup
else
LocalMachineSSHSetup
fi



echo "### setup NIX_PATH as"
echo "export NIX_PATH=${NIX_PATH}"
VAL_EXPORT="export NIX_PATH=${NIX_PATH}"
echo "$VAL_EXPORT"
eval "$VAL_EXPORT"

0 comments on commit 247ebb7

Please sign in to comment.