Skip to content

Commit

Permalink
Merge z files (#5)
Browse files Browse the repository at this point in the history
  • Loading branch information
marchdf authored Sep 17, 2024
1 parent 0863a4e commit 98e88e3
Show file tree
Hide file tree
Showing 4 changed files with 97 additions and 109 deletions.
34 changes: 17 additions & 17 deletions dot_local/share/zinit/plugins/hpc/hpc.plugin.zsh.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,23 @@ export TMPDIR=${SCRATCH}/.tmp

umask u=rwx,go=rx,o=rx

function pv510server() {
module load paraview/5.10.1-server
srun -n $1 -c 1 --cpu_bind=cores pvserver
}

function pv510gui() {
module load paraview/5.10.1-gui
vglrun paraview
}

function pvtunnel() {
ssh -L 11111:$1:11111 mhenryde@$1
}

{{ end }}

{{- if or (.nrel_hpc) (.ornl_hpc) }}
function load_custom_modules {

{
Expand Down Expand Up @@ -91,23 +108,6 @@ function load_custom_modules {
} &> /dev/null
}

function pv510server() {
module load paraview/5.10.1-server
srun -n $1 -c 1 --cpu_bind=cores pvserver
}

function pv510gui() {
module load paraview/5.10.1-gui
vglrun paraview
}

function pvtunnel() {
ssh -L 11111:$1:11111 mhenryde@$1
}

{{ end }}

{{- if or (.nrel_hpc) (.ornl_hpc) }}
load_custom_modules
{{ end }}

Expand Down
4 changes: 0 additions & 4 deletions dot_zlogin

This file was deleted.

88 changes: 0 additions & 88 deletions dot_zshenv.tmpl

This file was deleted.

80 changes: 80 additions & 0 deletions dot_zshrc → dot_zshrc.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,86 @@ zinit light-mode for \

### End of Zinit's installer chunk

# Setup up some paths and environment variables

# homebrew
if [ -d "/opt/homebrew" ]; then
eval "$(/opt/homebrew/bin/brew shellenv)"
fi

export PATH="${HOME}/bin:${HOME}/.local/bin:${PATH}"

# miniconda
MINICONDA_DIR="${HOME}/miniconda3"
if [ -d "${MINICONDA_DIR}" ]; then
# >>> conda initialize >>>
__conda_setup="$('${MINICONDA_DIR}/conda' 'shell.zsh' 'hook' 2> /dev/null)"
if [ $? -eq 0 ]; then
eval "$__conda_setup"
else
if [ -f "${MINICONDA_DIR}/etc/profile.d/conda.sh" ]; then
. "${MINICONDA_DIR}/etc/profile.d/conda.sh"
else
export PATH="${MINICONDA_DIR}/bin:$PATH"
fi
fi
unset __conda_setup
# <<< conda initialize <<<
fi

# Spack home directory
if [ -d "${HOME}/spack" ]; then
export SPACK_DIR="${HOME}/spack"
fi

# combustion directory
export COMBUSTION_DIR="${HOME}/combustion"
export MASA_HOME="${COMBUSTION_DIR}/install/MASA"

# pyenv
export PYENV_ROOT="${HOME}/.pyenv"
if [ -d "${PYENV_ROOT}" ]; then
command -v pyenv >/dev/null || export PATH="$PYENV_ROOT/bin:$PATH"
eval "$(pyenv init -)"
fi

# poetry
if [ -d "${HOME}/.poetry" ]; then
export PATH="$HOME/.poetry/bin:$PATH"
fi

# exawind-manager
if [ -d "${HOME}/exawind/exawind-manager" ]; then
export EXAWIND_MANAGER=${HOME}/exawind/exawind-manager
source ${EXAWIND_MANAGER}/start.sh
fi

# zoxide
export _ZO_DATA_DIR=$HOME/.local/share

# hunspell dicts
if [ -d "${HOME}/.local/share/hunspell/dicts" ]; then
export DICPATH="${HOME}/.local/share/hunspell/dicts"
fi

export WORKON_HOME=${HOME}/.virtualenvs

{{- if eq .chezmoi.os "darwin" }}

# paths for Mac OSX

# github tokens
source "${HOME}/.github_tokens"

# openmpi fails because tmp dir name is too long
# see: https://www.open-mpi.org/faq/?category=osx
export TMPDIR=/tmp

# Set vlc for terminal
alias vlc="{HOME}/Applications/VLC.app/Contents/MacOS/VLC"

{{- end }}

# towards the beginning to make sure some software is loaded
zinit lucid light-mode for "hpc"

Expand Down

0 comments on commit 98e88e3

Please sign in to comment.