From 2aaefa3497e64d36b45127d32df1f94714ceed5f Mon Sep 17 00:00:00 2001 From: Marc Henry de Frahan Date: Thu, 25 Jan 2024 11:04:19 -0700 Subject: [PATCH 01/78] remove unused stuff --- dot_zshrc | 92 ------------------------------------------------------- 1 file changed, 92 deletions(-) diff --git a/dot_zshrc b/dot_zshrc index 264ae22..100c9c9 100644 --- a/dot_zshrc +++ b/dot_zshrc @@ -12,79 +12,13 @@ if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]] source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" fi -# If you come from bash you might have to change your $PATH. -# export PATH=$HOME/bin:/usr/local/bin:$PATH - # Path to your oh-my-zsh installation. export ZSH=$HOME/.oh-my-zsh -# Set name of the theme to load --- if set to "random", it will -# load a random theme each time oh-my-zsh is loaded, in which case, -# to know which specific one was loaded, run: echo $RANDOM_THEME -# See https://github.com/ohmyzsh/ohmyzsh/wiki/Themes -ZSH_THEME="robbyrussell" - -# Set list of themes to pick from when loading at random -# Setting this variable when ZSH_THEME=random will cause zsh to load -# a theme from this variable instead of looking in ~/.oh-my-zsh/themes/ -# If set to an empty array, this variable will have no effect. -# ZSH_THEME_RANDOM_CANDIDATES=( "robbyrussell" "agnoster" ) - -# If this variable is set the random theme won't choose any of the -# themes specified in this array. This is useful if you know -# specifically the themes that you don't like or don't work correctly -# in your environment. NOTE: if the ZSH_THEME_RANDOM_CANDIDATES -# variable is set (see above), this setting has no effect. -ZSH_THEME_RANDOM_IGNORED=( "dallas" "juanghurtado" ) - -# Uncomment the following line to use case-sensitive completion. -# CASE_SENSITIVE="true" - -# Uncomment the following line to use hyphen-insensitive completion. -# Case-sensitive completion must be off. _ and - will be interchangeable. -# HYPHEN_INSENSITIVE="true" - -# Uncomment the following line to disable bi-weekly auto-update checks. -# DISABLE_AUTO_UPDATE="true" - -# Uncomment the following line to automatically update without prompting. -# DISABLE_UPDATE_PROMPT="true" - -# Uncomment the following line to change how often to auto-update (in days). -# export UPDATE_ZSH_DAYS=13 - -# Uncomment the following line if pasting URLs and other text is messed up. -# DISABLE_MAGIC_FUNCTIONS=true - -# Uncomment the following line to disable colors in ls. -# DISABLE_LS_COLORS="true" - -# Uncomment the following line to disable auto-setting terminal title. -# DISABLE_AUTO_TITLE="true" - # Uncomment the following line to enable command auto-correction. ENABLE_CORRECTION="true" CORRECT_IGNORE_FILE='.*' -# Uncomment the following line to display red dots whilst waiting for completion. -# COMPLETION_WAITING_DOTS="true" - -# Uncomment the following line if you want to disable marking untracked files -# under VCS as dirty. This makes repository status check for large repositories -# much, much faster. -# DISABLE_UNTRACKED_FILES_DIRTY="true" - -# Uncomment the following line if you want to change the command execution time -# stamp shown in the history command output. -# You can set one of the optional three formats: -# "mm/dd/yyyy"|"dd.mm.yyyy"|"yyyy-mm-dd" -# or set a custom format using the strftime function format specifications, -# see 'man strftime' for details. -# HIST_STAMPS="mm/dd/yyyy" - -# Would you like to use another custom folder than $ZSH/custom? -# ZSH_CUSTOM=/path/to/new-custom-folder - # Which plugins would you like to load? # Standard plugins can be found in ~/.oh-my-zsh/plugins/* # Custom plugins may be added to ~/.oh-my-zsh/custom/plugins/ @@ -96,35 +30,9 @@ source $ZSH/oh-my-zsh.sh # User configuration -# export MANPATH="/usr/local/man:$MANPATH" - # better terminal colors export TERM=xterm-256color -# You may need to manually set your language environment -# export LANG=en_US.UTF-8 - -# Preferred editor for local and remote sessions -# if [[ -n $SSH_CONNECTION ]]; then -# export EDITOR='vim' -# else -# export EDITOR='mvim' -# fi - -# Compilation flags -# export ARCHFLAGS="-arch x86_64" - -# Set personal aliases, overriding those provided by oh-my-zsh libs, -# plugins, and themes. Aliases can be placed here, though oh-my-zsh -# users are encouraged to define aliases within the ZSH_CUSTOM folder. -# For a full list of active aliases, run `alias`. -# -# Example aliases -# alias zshconfig="mate ~/.zshrc" -# alias ohmyzsh="mate ~/.oh-my-zsh" - - -# # This is a bit sneaky... but nice! # Separate up arrow lookback for local and global ZSH history # http://superuser.com/questions/446594/separate-up-arrow-lookback-for-local-and-global-zsh-history/691603 From 4d5ff33539e28757ac7ff1f44317bd963052cfcf Mon Sep 17 00:00:00 2001 From: Marc Henry de Frahan Date: Thu, 25 Jan 2024 11:11:55 -0700 Subject: [PATCH 02/78] remove unused plugins --- dot_zshrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dot_zshrc b/dot_zshrc index 100c9c9..a5bb74b 100644 --- a/dot_zshrc +++ b/dot_zshrc @@ -24,7 +24,7 @@ CORRECT_IGNORE_FILE='.*' # Custom plugins may be added to ~/.oh-my-zsh/custom/plugins/ # Example format: plugins=(rails git textmate ruby lighthouse) # Add wisely, as too many plugins slow down shell startup. -plugins=(battery emacs git screen tmux fzf poetry pyenv) +plugins=(emacs git tmux fzf poetry pyenv) source $ZSH/oh-my-zsh.sh From 025a89d9726cd94825ad7c0620512979f08c530a Mon Sep 17 00:00:00 2001 From: Marc Henry de Frahan Date: Thu, 25 Jan 2024 13:09:02 -0700 Subject: [PATCH 03/78] remove unused function --- dot_oh-my-zsh/custom/functions_nrel_hpc.zsh | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/dot_oh-my-zsh/custom/functions_nrel_hpc.zsh b/dot_oh-my-zsh/custom/functions_nrel_hpc.zsh index e5ba823..c4332bd 100644 --- a/dot_oh-my-zsh/custom/functions_nrel_hpc.zsh +++ b/dot_oh-my-zsh/custom/functions_nrel_hpc.zsh @@ -29,16 +29,6 @@ if [ "${NREL_CLUSTER}" = "eagle" ] || [ "${NREL_CLUSTER}" = "rhodes" ] || [ "${N } &> /dev/null } - function load_spack_python3 { - - { - module load python/3.7.7 - while read -r line ; do - module load $line - done < <(module --raw --redirect avail | grep -o 'py-\S*') - } &> /dev/null - } - function pv59server() { source /nopt/nrel/ecom/exawind/exawind/scripts/exawind-env-gcc.sh case $# in From 2ae4108070392d285f69f87b9fd38d42e7b99715 Mon Sep 17 00:00:00 2001 From: Marc Henry de Frahan Date: Thu, 25 Jan 2024 13:11:43 -0700 Subject: [PATCH 04/78] more unused --- dot_oh-my-zsh/custom/functions_nrel_hpc.zsh | 37 ++------------------- 1 file changed, 3 insertions(+), 34 deletions(-) diff --git a/dot_oh-my-zsh/custom/functions_nrel_hpc.zsh b/dot_oh-my-zsh/custom/functions_nrel_hpc.zsh index c4332bd..4de151a 100644 --- a/dot_oh-my-zsh/custom/functions_nrel_hpc.zsh +++ b/dot_oh-my-zsh/custom/functions_nrel_hpc.zsh @@ -29,21 +29,9 @@ if [ "${NREL_CLUSTER}" = "eagle" ] || [ "${NREL_CLUSTER}" = "rhodes" ] || [ "${N } &> /dev/null } - function pv59server() { - source /nopt/nrel/ecom/exawind/exawind/scripts/exawind-env-gcc.sh - case $# in - "0" ) - srun -n 1 -c 1 --cpu_bind=cores /nopt/nrel/ecom/exawind/exawind/install/paraview/5.9.0/bin/pvserver - ;; - "1" ) - srun -n $1 -c 1 --cpu_bind=cores /nopt/nrel/ecom/exawind/exawind/install/paraview/5.9.0/bin/pvserver - ;; - esac - } - - function pv59gui() { - source /nopt/nrel/ecom/exawind/exawind/scripts/exawind-env-gcc.sh - vglrun /nopt/nrel/ecom/exawind/exawind/install/paraview/5.9.0/bin/paraview + function pv510server() { + module load paraview/5.10.1-server + srun -n $1 -c 1 --cpu_bind=cores pvserver } function pv510gui() { @@ -51,25 +39,6 @@ if [ "${NREL_CLUSTER}" = "eagle" ] || [ "${NREL_CLUSTER}" = "rhodes" ] || [ "${N vglrun paraview } - function pv58server() { - source /nopt/nrel/ecom/exawind/exawind/scripts/exawind-env-gcc.sh - module load paraview/5.8.1-server - case $# in - "0" ) - srun -n 1 -c 1 --cpu_bind=cores pvserver - ;; - "1" ) - srun -n $1 -c 1 --cpu_bind=cores pvserver - ;; - esac - } - - function pv58gui() { - source /nopt/nrel/ecom/exawind/exawind/scripts/exawind-env-gcc.sh - module load paraview/5.8.1-gui - vglrun paraview - } - function pvtunnel() { ssh -L 11111:$1:11111 mhenryde@$1 } From 66018052f9caae17c099a172569cd4113846d3e0 Mon Sep 17 00:00:00 2001 From: Marc Henry de Frahan Date: Thu, 25 Jan 2024 13:36:16 -0700 Subject: [PATCH 05/78] remove rhodes --- dot_oh-my-zsh/custom/functions_nrel_hpc.zsh | 2 +- dot_ssh/config | 4 ---- dot_zshenv.tmpl | 4 +--- dot_zshrc | 2 +- 4 files changed, 3 insertions(+), 9 deletions(-) diff --git a/dot_oh-my-zsh/custom/functions_nrel_hpc.zsh b/dot_oh-my-zsh/custom/functions_nrel_hpc.zsh index 4de151a..0d8a667 100644 --- a/dot_oh-my-zsh/custom/functions_nrel_hpc.zsh +++ b/dot_oh-my-zsh/custom/functions_nrel_hpc.zsh @@ -1,5 +1,5 @@ # These are my custom aliases for my NREL HPC machines -if [ "${NREL_CLUSTER}" = "eagle" ] || [ "${NREL_CLUSTER}" = "rhodes" ] || [ "${NREL_CLUSTER}" = "ellis" ]; then +if [ "${NREL_CLUSTER}" = "eagle" ] || [ "${NREL_CLUSTER}" = "ellis" ]; then function load_custom_modules { diff --git a/dot_ssh/config b/dot_ssh/config index ca0d5b7..272982e 100644 --- a/dot_ssh/config +++ b/dot_ssh/config @@ -46,10 +46,6 @@ host merlin User mhenryde hostname merlin.hpc.nrel.gov -host rhodes - User mhenryde - hostname rhodes.hpc.nrel.gov - host ellis User mhenryde hostname ellis.hpc.nrel.gov diff --git a/dot_zshenv.tmpl b/dot_zshenv.tmpl index fa6a0f4..3bf01ab 100644 --- a/dot_zshenv.tmpl +++ b/dot_zshenv.tmpl @@ -85,7 +85,7 @@ alias vlc="{HOME}/Applications/VLC.app/Contents/MacOS/VLC" # paths for NREL HPC -if [ "${NREL_CLUSTER}" = "eagle" ] || [ "${NREL_CLUSTER}" = "rhodes" ] || [ "${NREL_CLUSTER}" = "ellis" ]; then +if [ "${NREL_CLUSTER}" = "eagle" ] || [ "${NREL_CLUSTER}" = "ellis" ]; then # Set scratch if [ -d "/scratch/${USER}" ]; then @@ -98,8 +98,6 @@ if [ "${NREL_CLUSTER}" = "eagle" ] || [ "${NREL_CLUSTER}" = "rhodes" ] || [ "${N source /nopt/nrel/ecom/hpacf/env.sh module use ${HOME}/modules/linux-centos7-skylake_avx512/gcc-9.3.0 export TMPDIR=${SCRATCH}/.tmp - elif [ "${NREL_CLUSTER}" = "rhodes" ]; then - source /opt/base/env.sh elif [ "${NREL_CLUSTER}" = "ellis" ]; then MODULES_DATE=2023-05-11 source /data/ssd1/software/${MODULES_DATE}/env.sh diff --git a/dot_zshrc b/dot_zshrc index a5bb74b..7a5c364 100644 --- a/dot_zshrc +++ b/dot_zshrc @@ -81,7 +81,7 @@ SAVEHIST=$HISTSIZE setopt HIST_IGNORE_ALL_DUPS setopt HIST_FIND_NO_DUPS -if [ "${NREL_CLUSTER}" = "eagle" ] || [ "${NREL_CLUSTER}" = "rhodes" ] || [ "${NREL_CLUSTER}" = "ellis" ]; then +if [ "${NREL_CLUSTER}" = "eagle" ] || [ "${NREL_CLUSTER}" = "ellis" ]; then umask u=rwx,go=rx,o=rx fi From 3667727a1dc15fe7523ab02bd0dbf79b6ca73678 Mon Sep 17 00:00:00 2001 From: Marc Henry de Frahan Date: Thu, 25 Jan 2024 15:58:46 -0700 Subject: [PATCH 06/78] add zinit remove zplug --- dot_zshenv.tmpl | 5 --- dot_zshrc | 44 ++++++++++++++----- run_once_before_install-packages-cli.sh | 5 +++ ...nce_before_install-packages-darwin.sh.tmpl | 6 --- ...once_before_install-packages-linux.sh.tmpl | 8 ++++ 5 files changed, 45 insertions(+), 23 deletions(-) create mode 100644 run_once_before_install-packages-cli.sh create mode 100644 run_once_before_install-packages-linux.sh.tmpl diff --git a/dot_zshenv.tmpl b/dot_zshenv.tmpl index 3bf01ab..ea8ae96 100644 --- a/dot_zshenv.tmpl +++ b/dot_zshenv.tmpl @@ -44,11 +44,6 @@ fi export COMBUSTION_DIR="${HOME}/combustion" export MASA_HOME="${COMBUSTION_DIR}/install/MASA" -# Zplug -if [ -d "${HOME}/.zplug" ]; then - export ZPLUG_HOME="${HOME}/.zplug" -fi - # spack-manager if [ -d "${HOME}/exawind/spack-manager" ]; then export SPACK_MANAGER=${HOME}/exawind/spack-manager diff --git a/dot_zshrc b/dot_zshrc index 7a5c364..4ba4ff1 100644 --- a/dot_zshrc +++ b/dot_zshrc @@ -12,6 +12,38 @@ if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]] source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" fi +### Added by Zinit's installer +if [[ ! -f $HOME/.local/share/zinit/zinit.git/zinit.zsh ]]; then + print -P "%F{33} %F{220}Installing %F{33}ZDHARMA-CONTINUUM%F{220} Initiative Plugin Manager (%F{33}zdharma-continuum/zinit%F{220})…%f" + command mkdir -p "$HOME/.local/share/zinit" && command chmod g-rwX "$HOME/.local/share/zinit" + command git clone https://github.com/zdharma-continuum/zinit "$HOME/.local/share/zinit/zinit.git" && \ + print -P "%F{33} %F{34}Installation successful.%f%b" || \ + print -P "%F{160} The clone has failed.%f%b" +fi + +source "$HOME/.local/share/zinit/zinit.git/zinit.zsh" +autoload -Uz _zinit +(( ${+_comps} )) && _comps[zinit]=_zinit + +# Load a few important annexes, without Turbo +# (this is currently required for annexes) +zinit light-mode for \ + zdharma-continuum/zinit-annex-as-monitor \ + zdharma-continuum/zinit-annex-bin-gem-node \ + zdharma-continuum/zinit-annex-patch-dl \ + zdharma-continuum/zinit-annex-rust + +### End of Zinit's installer chunk + +zinit ice lucid depth"1" +zinit light romkatv/powerlevel10k + +zinit ice lucid wait='1' +zinit light skywind3000/z.lua + + +zinit wait lucid light-mode for id-as'auto' has'fzf' @Aloxaf/fzf-tab + # Path to your oh-my-zsh installation. export ZSH=$HOME/.oh-my-zsh @@ -62,18 +94,6 @@ bindkey "^[[1;5B" down-line-or-history # [CTRL] + Cursor down bindkey "^P" up-line-or-beginning-search # bindkey "^N" down-line-or-beginning-search -# zplug -if [ -d "${ZPLUG_HOME}" ]; then - source "${ZPLUG_HOME}/init.zsh" - zplug "skywind3000/z.lua" - zplug "Aloxaf/fzf-tab" - zplug "romkatv/powerlevel10k", as:theme, depth:1 - zplug load - if ! zplug check; then - zplug install - fi -fi - # Better history HISTFILE=~/.zsh_history HISTSIZE=1000000 diff --git a/run_once_before_install-packages-cli.sh b/run_once_before_install-packages-cli.sh new file mode 100644 index 0000000..2bb41bb --- /dev/null +++ b/run_once_before_install-packages-cli.sh @@ -0,0 +1,5 @@ +#!/usr/bin/env bash + +if [[ ! -x "$(command -v poetry)" ]]; then + curl -sSL https://install.python-poetry.org | POETRY_VERSION=1.7.0 POETRY_HOME=${HOME}/.poetry python3 - +fi diff --git a/run_once_before_install-packages-darwin.sh.tmpl b/run_once_before_install-packages-darwin.sh.tmpl index 4cf5ec3..f874cfc 100644 --- a/run_once_before_install-packages-darwin.sh.tmpl +++ b/run_once_before_install-packages-darwin.sh.tmpl @@ -76,7 +76,6 @@ brew "wget" brew "xpdf" brew "xz" brew "zlib" -brew "zplug" cask_args appdir: "~/Applications" cask "font-fira-code-nerd-font" @@ -105,9 +104,4 @@ EOF brew pin gcc brew pin mpich -ZPLUG_HOME="${HOME}/.zplug" -if [ ! -d "${ZPLUG_HOME}" ]; then - ln -s /opt/homebrew/opt/zplug ${ZPLUG_HOME} -fi - {{ end -}} diff --git a/run_once_before_install-packages-linux.sh.tmpl b/run_once_before_install-packages-linux.sh.tmpl new file mode 100644 index 0000000..d77f777 --- /dev/null +++ b/run_once_before_install-packages-linux.sh.tmpl @@ -0,0 +1,8 @@ +{{- if eq .chezmoi.os "linux" -}} +#!/usr/bin/env bash + +if [[ ! -x "$(command -v pyenv)" ]]; then + curl https://pyenv.run | bash +fi + +{{ end -}} From 28d4e3c38edd4666bcbfef6cde10244ae1959226 Mon Sep 17 00:00:00 2001 From: Marc Henry de Frahan Date: Thu, 25 Jan 2024 16:20:04 -0700 Subject: [PATCH 07/78] remove z.lua replace with zoxide --- dot_zshenv.tmpl | 3 +++ dot_zshrc | 3 +-- run_once_before_install-packages-cli.sh | 5 +++++ 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/dot_zshenv.tmpl b/dot_zshenv.tmpl index ea8ae96..3b4790b 100644 --- a/dot_zshenv.tmpl +++ b/dot_zshenv.tmpl @@ -62,6 +62,9 @@ if [ -d "${HOME}/.poetry" ]; then export PATH="$HOME/.poetry/bin:$PATH" fi +# zoxide +export _ZO_DATA_DIR=$HOME/.local/share + {{- if eq .chezmoi.os "darwin" }} # paths for Mac OSX diff --git a/dot_zshrc b/dot_zshrc index 4ba4ff1..b26bdb1 100644 --- a/dot_zshrc +++ b/dot_zshrc @@ -38,9 +38,8 @@ zinit light-mode for \ zinit ice lucid depth"1" zinit light romkatv/powerlevel10k -zinit ice lucid wait='1' -zinit light skywind3000/z.lua +zinit snippet "OMZ::plugins/zoxide/zoxide.plugin.zsh" zinit wait lucid light-mode for id-as'auto' has'fzf' @Aloxaf/fzf-tab diff --git a/run_once_before_install-packages-cli.sh b/run_once_before_install-packages-cli.sh index 2bb41bb..af5ca90 100644 --- a/run_once_before_install-packages-cli.sh +++ b/run_once_before_install-packages-cli.sh @@ -3,3 +3,8 @@ if [[ ! -x "$(command -v poetry)" ]]; then curl -sSL https://install.python-poetry.org | POETRY_VERSION=1.7.0 POETRY_HOME=${HOME}/.poetry python3 - fi + +if [[ ! -x "$(command -v zoxide)" ]]; then + curl -sS https://raw.githubusercontent.com/ajeetdsouza/zoxide/main/install.sh | bash +fi + From 2dd03778a9a810dce487bdbfd1a50f5abf0affbf Mon Sep 17 00:00:00 2001 From: Marc Henry de Frahan Date: Thu, 25 Jan 2024 16:28:48 -0700 Subject: [PATCH 08/78] reduce what is loaded by omz --- dot_zshrc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/dot_zshrc b/dot_zshrc index b26bdb1..70b6ef5 100644 --- a/dot_zshrc +++ b/dot_zshrc @@ -39,6 +39,11 @@ zinit ice lucid depth"1" zinit light romkatv/powerlevel10k + +zinit snippet "OMZ::plugins/git/git.plugin.zsh" +zinit snippet "OMZ::plugins/poetry/poetry.plugin.zsh" +zinit snippet "OMZ::plugins/pyenv/pyenv.plugin.zsh" +zinit snippet "OMZ::plugins/tmux/tmux.plugin.zsh" zinit snippet "OMZ::plugins/zoxide/zoxide.plugin.zsh" zinit wait lucid light-mode for id-as'auto' has'fzf' @Aloxaf/fzf-tab @@ -55,7 +60,7 @@ CORRECT_IGNORE_FILE='.*' # Custom plugins may be added to ~/.oh-my-zsh/custom/plugins/ # Example format: plugins=(rails git textmate ruby lighthouse) # Add wisely, as too many plugins slow down shell startup. -plugins=(emacs git tmux fzf poetry pyenv) +plugins=(emacs fzf) source $ZSH/oh-my-zsh.sh From a6cdc0d1d7399ef6f117f3eab78751206625a15f Mon Sep 17 00:00:00 2001 From: Marc Henry de Frahan Date: Fri, 26 Jan 2024 09:32:00 -0700 Subject: [PATCH 09/78] better plugin --- dot_zshrc | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/dot_zshrc b/dot_zshrc index 70b6ef5..0e6af53 100644 --- a/dot_zshrc +++ b/dot_zshrc @@ -38,13 +38,12 @@ zinit light-mode for \ zinit ice lucid depth"1" zinit light romkatv/powerlevel10k - - -zinit snippet "OMZ::plugins/git/git.plugin.zsh" -zinit snippet "OMZ::plugins/poetry/poetry.plugin.zsh" -zinit snippet "OMZ::plugins/pyenv/pyenv.plugin.zsh" -zinit snippet "OMZ::plugins/tmux/tmux.plugin.zsh" -zinit snippet "OMZ::plugins/zoxide/zoxide.plugin.zsh" +zinit wait lucid for \ + "OMZP::git" \ + "OMZP::poetry" \ + "OMZP::pyenv" \ + "OMZP::tmux" \ + "OMZP::zoxide" zinit wait lucid light-mode for id-as'auto' has'fzf' @Aloxaf/fzf-tab From 1fc2063dc8a5fe550da0b7c63b6b62068da3e48f Mon Sep 17 00:00:00 2001 From: Marc Henry de Frahan Date: Fri, 26 Jan 2024 10:17:29 -0700 Subject: [PATCH 10/78] use fzf plugin --- dot_zshrc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dot_zshrc b/dot_zshrc index 0e6af53..29c0ae1 100644 --- a/dot_zshrc +++ b/dot_zshrc @@ -45,6 +45,7 @@ zinit wait lucid for \ "OMZP::tmux" \ "OMZP::zoxide" +zinit wait lucid light-mode for has'fzf' "OMZP::fzf" zinit wait lucid light-mode for id-as'auto' has'fzf' @Aloxaf/fzf-tab # Path to your oh-my-zsh installation. @@ -59,7 +60,7 @@ CORRECT_IGNORE_FILE='.*' # Custom plugins may be added to ~/.oh-my-zsh/custom/plugins/ # Example format: plugins=(rails git textmate ruby lighthouse) # Add wisely, as too many plugins slow down shell startup. -plugins=(emacs fzf) +plugins=(emacs) source $ZSH/oh-my-zsh.sh From 666ebe11e5585ad657253b8962bbf48593a9d62a Mon Sep 17 00:00:00 2001 From: Marc Henry de Frahan Date: Fri, 26 Jan 2024 10:22:18 -0700 Subject: [PATCH 11/78] put together --- dot_zshrc | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/dot_zshrc b/dot_zshrc index 29c0ae1..6f8bf04 100644 --- a/dot_zshrc +++ b/dot_zshrc @@ -38,16 +38,15 @@ zinit light-mode for \ zinit ice lucid depth"1" zinit light romkatv/powerlevel10k -zinit wait lucid for \ +zinit wait lucid light-mode for \ + has'fzf' "OMZP::fzf" \ + has'fzf' @Aloxaf/fzf-tab \ "OMZP::git" \ "OMZP::poetry" \ "OMZP::pyenv" \ "OMZP::tmux" \ "OMZP::zoxide" -zinit wait lucid light-mode for has'fzf' "OMZP::fzf" -zinit wait lucid light-mode for id-as'auto' has'fzf' @Aloxaf/fzf-tab - # Path to your oh-my-zsh installation. export ZSH=$HOME/.oh-my-zsh From 7e17d56a0e6d3e80e93b3f2ee2261fa0896c924f Mon Sep 17 00:00:00 2001 From: Marc Henry de Frahan Date: Fri, 26 Jan 2024 12:02:18 -0700 Subject: [PATCH 12/78] Add a test --- .github/workflows/ci.yml | 22 ++++++++++++++++++++++ run_once_after_install-tests.sh | 10 ++++++++++ 2 files changed, 32 insertions(+) create mode 100644 .github/workflows/ci.yml create mode 100644 run_once_after_install-tests.sh diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..bb528e8 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,22 @@ +name: dotfiles-CI + +on: + workflow_dispatch: + push: + branches: [development] + pull_request: + branches: [development] + +concurrency: + group: ${{github.ref}}-${{github.head_ref}}-ci + cancel-in-progress: true + +jobs: + OSX: + runs-on: macos-latest + steps: + - name: Clone + uses: actions/checkout@v4 + - name: Dependencies + run: | + brew install chezmoi diff --git a/run_once_after_install-tests.sh b/run_once_after_install-tests.sh new file mode 100644 index 0000000..e0d2d46 --- /dev/null +++ b/run_once_after_install-tests.sh @@ -0,0 +1,10 @@ +#!/usr/bin/env bash + +cmds=( "fzf" "poetry" "pyenv" "zoxide" ) +for cmd in "${cmds[@]}" +do + if [[ ! -x "$(command -v $cmd)" ]]; then + echo "$cmd was not installed!" + exit 1 + fi +done From c496547f8019e3bc6effde8c16e607d413ca11ec Mon Sep 17 00:00:00 2001 From: Marc Henry de Frahan Date: Fri, 26 Jan 2024 12:03:37 -0700 Subject: [PATCH 13/78] fix ci --- .github/workflows/ci.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index bb528e8..4e54855 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -3,9 +3,11 @@ name: dotfiles-CI on: workflow_dispatch: push: - branches: [development] + branches: [main] pull_request: - branches: [development] + branches: [main] + schedule: + - cron: "0 5 * * 1" concurrency: group: ${{github.ref}}-${{github.head_ref}}-ci From f003975fab975e7712598fec479b1284dbce6fd9 Mon Sep 17 00:00:00 2001 From: Marc Henry de Frahan Date: Fri, 26 Jan 2024 12:11:06 -0700 Subject: [PATCH 14/78] try applying --- .github/workflows/ci.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4e54855..2782761 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -17,8 +17,11 @@ jobs: OSX: runs-on: macos-latest steps: - - name: Clone - uses: actions/checkout@v4 - name: Dependencies run: | brew install chezmoi + - name: Install + run: | + chezmoi init git@github.com:marchdf/dotfiles.git + chezmoi diff + chezmoi apply -v From 2f30f85e617b2c973e9bd599b9221e41635b4663 Mon Sep 17 00:00:00 2001 From: Marc Henry de Frahan Date: Fri, 26 Jan 2024 12:29:53 -0700 Subject: [PATCH 15/78] change url --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2782761..3e9d35f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -22,6 +22,6 @@ jobs: brew install chezmoi - name: Install run: | - chezmoi init git@github.com:marchdf/dotfiles.git + chezmoi init https://github.com/marchdf/dotfiles.git chezmoi diff chezmoi apply -v From 8af9ee0b63a2e930e872b9dbe673a533bb2dce71 Mon Sep 17 00:00:00 2001 From: Marc Henry de Frahan Date: Fri, 26 Jan 2024 13:21:32 -0700 Subject: [PATCH 16/78] better prompts --- .chezmoi.toml.tmpl | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.chezmoi.toml.tmpl b/.chezmoi.toml.tmpl index 7fccded..8f176fd 100644 --- a/.chezmoi.toml.tmpl +++ b/.chezmoi.toml.tmpl @@ -2,8 +2,12 @@ command = "emacs" args = ["-nw"] -{{- $use_zsh_root_dir := promptBoolOnce . "use_zsh_root_dir" "Use ZSH_ROOT_DIR for tmux shell" }} -{{ $email := promptString "email" -}} +{{ $email := "" }} +{{ $use_zsh_root_dir := false }} +{{ if stdinIsATTY }} +{{- $use_zsh_root_dir = promptBool "Use ZSH_ROOT_DIR for tmux shell" }} +{{ $email = promptString "email" -}} +{{ end }} [data] use_zsh_root_dir = {{ $use_zsh_root_dir }} From dd010d8da72a68cc332fe59ac7f292d0ac24a4ec Mon Sep 17 00:00:00 2001 From: Marc Henry de Frahan Date: Fri, 26 Jan 2024 13:29:56 -0700 Subject: [PATCH 17/78] minor ci tweak --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3e9d35f..e7ef0f6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -22,6 +22,6 @@ jobs: brew install chezmoi - name: Install run: | - chezmoi init https://github.com/marchdf/dotfiles.git + chezmoi init https://github.com/marchdf/dotfiles.git --branch zsh-clean chezmoi diff chezmoi apply -v From 1280e9ee90b59d3b409c1104257bc7afaf54221d Mon Sep 17 00:00:00 2001 From: Marc Henry de Frahan Date: Fri, 26 Jan 2024 13:33:24 -0700 Subject: [PATCH 18/78] remove diff --- .github/workflows/ci.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e7ef0f6..8179945 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -23,5 +23,4 @@ jobs: - name: Install run: | chezmoi init https://github.com/marchdf/dotfiles.git --branch zsh-clean - chezmoi diff chezmoi apply -v From cee0b4ef0d9b6ad3098882ded5bacbfbc0ca7ec6 Mon Sep 17 00:00:00 2001 From: Marc Henry de Frahan Date: Fri, 26 Jan 2024 16:35:57 -0700 Subject: [PATCH 19/78] test this --- .chezmoi.toml.tmpl | 10 +++------- .github/workflows/ci.yml | 5 +++-- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/.chezmoi.toml.tmpl b/.chezmoi.toml.tmpl index 8f176fd..290278d 100644 --- a/.chezmoi.toml.tmpl +++ b/.chezmoi.toml.tmpl @@ -2,13 +2,9 @@ command = "emacs" args = ["-nw"] -{{ $email := "" }} -{{ $use_zsh_root_dir := false }} -{{ if stdinIsATTY }} -{{- $use_zsh_root_dir = promptBool "Use ZSH_ROOT_DIR for tmux shell" }} -{{ $email = promptString "email" -}} -{{ end }} +{{- $use_zsh_root_dir := promptBoolOnce . "use_zsh_root_dir" "Use ZSH_ROOT_DIR for tmux shell" }} +{{ $email := promptString "email" -}} [data] use_zsh_root_dir = {{ $use_zsh_root_dir }} - email = {{ $email | quote }} + email = {{ $email | quote }} \ No newline at end of file diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8179945..cb70237 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -22,5 +22,6 @@ jobs: brew install chezmoi - name: Install run: | - chezmoi init https://github.com/marchdf/dotfiles.git --branch zsh-clean - chezmoi apply -v + chezmoi init https://github.com/marchdf/dotfiles.git --branch ${GITHUB_REF##*/} --promptString email="" --promptBool use_zsh_root_dir=false + chezmoi data + # chezmoi apply -v From e905a80d8ebdbb5a87ef39816f82e8201a38fea3 Mon Sep 17 00:00:00 2001 From: Marc Henry de Frahan Date: Fri, 26 Jan 2024 16:38:00 -0700 Subject: [PATCH 20/78] this? --- .github/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index cb70237..4730906 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -22,6 +22,7 @@ jobs: brew install chezmoi - name: Install run: | + echo ${GITHUB_REF##*/} chezmoi init https://github.com/marchdf/dotfiles.git --branch ${GITHUB_REF##*/} --promptString email="" --promptBool use_zsh_root_dir=false chezmoi data # chezmoi apply -v From 13dc6132a96279ebdb0d46ebc03a50397c3e2b5e Mon Sep 17 00:00:00 2001 From: Marc Henry de Frahan Date: Fri, 26 Jan 2024 16:38:52 -0700 Subject: [PATCH 21/78] Another try --- .github/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4730906..c04fead 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -23,6 +23,7 @@ jobs: - name: Install run: | echo ${GITHUB_REF##*/} + echo ${{ github.event.pull_request.base.ref }} chezmoi init https://github.com/marchdf/dotfiles.git --branch ${GITHUB_REF##*/} --promptString email="" --promptBool use_zsh_root_dir=false chezmoi data # chezmoi apply -v From b666c0580d45f985f68ea1ff17e1e8d7870e1aa7 Mon Sep 17 00:00:00 2001 From: Marc Henry de Frahan Date: Fri, 26 Jan 2024 16:40:05 -0700 Subject: [PATCH 22/78] or this --- .github/workflows/ci.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c04fead..10e2c8b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -23,7 +23,8 @@ jobs: - name: Install run: | echo ${GITHUB_REF##*/} - echo ${{ github.event.pull_request.base.ref }} + echo ${{ github.event.pull_request.base.ref }} + echo ${{github.ref_name}} chezmoi init https://github.com/marchdf/dotfiles.git --branch ${GITHUB_REF##*/} --promptString email="" --promptBool use_zsh_root_dir=false chezmoi data # chezmoi apply -v From 9366f700f2160ad5b8a2916a98158c33d5bb8afa Mon Sep 17 00:00:00 2001 From: Marc Henry de Frahan Date: Fri, 26 Jan 2024 16:41:27 -0700 Subject: [PATCH 23/78] this? --- .github/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 10e2c8b..a6d3437 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -24,6 +24,7 @@ jobs: run: | echo ${GITHUB_REF##*/} echo ${{ github.event.pull_request.base.ref }} + echo ${{ github.event.pull_request.head.ref }} echo ${{github.ref_name}} chezmoi init https://github.com/marchdf/dotfiles.git --branch ${GITHUB_REF##*/} --promptString email="" --promptBool use_zsh_root_dir=false chezmoi data From e9e42122b23dbcd6ebf2e39bccbf6d6b35f12693 Mon Sep 17 00:00:00 2001 From: Marc Henry de Frahan Date: Fri, 26 Jan 2024 16:46:07 -0700 Subject: [PATCH 24/78] also this --- .github/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a6d3437..ccb7c6f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -26,6 +26,7 @@ jobs: echo ${{ github.event.pull_request.base.ref }} echo ${{ github.event.pull_request.head.ref }} echo ${{github.ref_name}} + echo ${{github.head_ref}} chezmoi init https://github.com/marchdf/dotfiles.git --branch ${GITHUB_REF##*/} --promptString email="" --promptBool use_zsh_root_dir=false chezmoi data # chezmoi apply -v From 06e1219b69a5ddaf21b719139ee97d6d63e34dde Mon Sep 17 00:00:00 2001 From: Marc Henry de Frahan Date: Fri, 26 Jan 2024 16:51:30 -0700 Subject: [PATCH 25/78] ok this --- .github/workflows/ci.yml | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ccb7c6f..5a8a210 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -22,11 +22,8 @@ jobs: brew install chezmoi - name: Install run: | - echo ${GITHUB_REF##*/} - echo ${{ github.event.pull_request.base.ref }} - echo ${{ github.event.pull_request.head.ref }} - echo ${{github.ref_name}} - echo ${{github.head_ref}} - chezmoi init https://github.com/marchdf/dotfiles.git --branch ${GITHUB_REF##*/} --promptString email="" --promptBool use_zsh_root_dir=false + export BRANCH=${{ github.head_ref || github.ref_name }} + echo $BRANCH + chezmoi init https://github.com/marchdf/dotfiles.git --branch ${BRANCH} --promptString email="" --promptBool use_zsh_root_dir=false chezmoi data # chezmoi apply -v From 9d9ff76edd6c8d4ff4e4a00ed3f8caf47aecd7e2 Mon Sep 17 00:00:00 2001 From: Marc Henry de Frahan Date: Fri, 26 Jan 2024 17:00:27 -0700 Subject: [PATCH 26/78] put better prompts back in --- .chezmoi.toml.tmpl | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.chezmoi.toml.tmpl b/.chezmoi.toml.tmpl index 290278d..dad1c7d 100644 --- a/.chezmoi.toml.tmpl +++ b/.chezmoi.toml.tmpl @@ -2,8 +2,12 @@ command = "emacs" args = ["-nw"] -{{- $use_zsh_root_dir := promptBoolOnce . "use_zsh_root_dir" "Use ZSH_ROOT_DIR for tmux shell" }} -{{ $email := promptString "email" -}} +{{ $email := "" }} +{{ $use_zsh_root_dir := false }} +{{ if stdinIsATTY }} +{{- $use_zsh_root_dir = promptBool "Use ZSH_ROOT_DIR for tmux shell" }} +{{ $email = promptString "email" -}} +{{ end }} [data] use_zsh_root_dir = {{ $use_zsh_root_dir }} From 16ff8def6717ebbd9f3171a97beefade42766c86 Mon Sep 17 00:00:00 2001 From: Marc Henry de Frahan Date: Fri, 26 Jan 2024 17:04:00 -0700 Subject: [PATCH 27/78] simplify --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5a8a210..77c7750 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -24,6 +24,6 @@ jobs: run: | export BRANCH=${{ github.head_ref || github.ref_name }} echo $BRANCH - chezmoi init https://github.com/marchdf/dotfiles.git --branch ${BRANCH} --promptString email="" --promptBool use_zsh_root_dir=false + chezmoi init https://github.com/marchdf/dotfiles.git --branch ${BRANCH} chezmoi data # chezmoi apply -v From 7dea160381264086a30ba77313de2baf4eec7be9 Mon Sep 17 00:00:00 2001 From: Marc Henry de Frahan Date: Sat, 27 Jan 2024 10:49:01 -0700 Subject: [PATCH 28/78] try this --- .chezmoi.toml.tmpl | 12 +++++------- .github/workflows/ci.yml | 2 +- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/.chezmoi.toml.tmpl b/.chezmoi.toml.tmpl index dad1c7d..2faf42d 100644 --- a/.chezmoi.toml.tmpl +++ b/.chezmoi.toml.tmpl @@ -2,13 +2,11 @@ command = "emacs" args = ["-nw"] -{{ $email := "" }} -{{ $use_zsh_root_dir := false }} -{{ if stdinIsATTY }} -{{- $use_zsh_root_dir = promptBool "Use ZSH_ROOT_DIR for tmux shell" }} -{{ $email = promptString "email" -}} -{{ end }} +{{ $use_zsh_root_dir := promptBoolOnce . "use_zsh_root_dir" "Use ZSH_ROOT_DIR for tmux shell" }} +{{ $email := promptStringOnce . "email" "email" -}} +{{ $test_machine := promptBoolOnce . "test_machine" "test_machine" }} [data] use_zsh_root_dir = {{ $use_zsh_root_dir }} - email = {{ $email | quote }} \ No newline at end of file + email = {{ $email | quote }} + test_machine = {{ $test_machine }} \ No newline at end of file diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 77c7750..689c868 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -24,6 +24,6 @@ jobs: run: | export BRANCH=${{ github.head_ref || github.ref_name }} echo $BRANCH - chezmoi init https://github.com/marchdf/dotfiles.git --branch ${BRANCH} + chezmoi init https://github.com/marchdf/dotfiles.git --branch ${BRANCH} --promptBool test=t,use_zsh_root_dir=f --promptString email="" chezmoi data # chezmoi apply -v From 3fe9ef8cabda92c6ad25afd88d1e5c439521bc9c Mon Sep 17 00:00:00 2001 From: Marc Henry de Frahan Date: Sat, 27 Jan 2024 11:16:53 -0700 Subject: [PATCH 29/78] try this --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 689c868..41aa911 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -24,6 +24,6 @@ jobs: run: | export BRANCH=${{ github.head_ref || github.ref_name }} echo $BRANCH - chezmoi init https://github.com/marchdf/dotfiles.git --branch ${BRANCH} --promptBool test=t,use_zsh_root_dir=f --promptString email="" + chezmoi init https://github.com/marchdf/dotfiles.git --branch ${BRANCH} --promptBool test_machine=t,"Use ZSH_ROOT_DIR for tmux shell"=f --promptString email="" chezmoi data # chezmoi apply -v From 2dfde6b3d1ed87cf6b0020bca1896b59f8555e60 Mon Sep 17 00:00:00 2001 From: Marc Henry de Frahan Date: Sat, 27 Jan 2024 11:20:53 -0700 Subject: [PATCH 30/78] try this too --- .github/workflows/ci.yml | 2 +- run_once_before_install-packages-darwin.sh.tmpl | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 41aa911..3182aa5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -26,4 +26,4 @@ jobs: echo $BRANCH chezmoi init https://github.com/marchdf/dotfiles.git --branch ${BRANCH} --promptBool test_machine=t,"Use ZSH_ROOT_DIR for tmux shell"=f --promptString email="" chezmoi data - # chezmoi apply -v + chezmoi apply -v diff --git a/run_once_before_install-packages-darwin.sh.tmpl b/run_once_before_install-packages-darwin.sh.tmpl index f874cfc..000e1d4 100644 --- a/run_once_before_install-packages-darwin.sh.tmpl +++ b/run_once_before_install-packages-darwin.sh.tmpl @@ -6,6 +6,10 @@ tap "homebrew/bundle" tap "jimeh/emacs-builds" tap "homebrew/cask-fonts" +brew "fzf" +brew "pyenv" + +{{- if not .test_machine }} brew "act" brew "age" brew "aspell" @@ -35,7 +39,6 @@ brew "faac" brew "fd" brew "fdk-aac" brew "flac123" -brew "fzf" brew "gcc" brew "git" brew "global" @@ -58,7 +61,6 @@ brew "openssl@3" brew "pandoc" brew "pianobar" brew "prettyping" -brew "pyenv" brew "python@3.10" brew "ripgrep" brew "shellcheck" @@ -99,6 +101,7 @@ cask "vivaldi" cask "vlc" cask "zoom" cask "zotero" +{{ end -}} EOF brew pin gcc From c6b8bde952614b7a96f440d5be92c9fa07532b9d Mon Sep 17 00:00:00 2001 From: Marc Henry de Frahan Date: Sat, 27 Jan 2024 11:31:37 -0700 Subject: [PATCH 31/78] better white space --- run_once_before_install-packages-darwin.sh.tmpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/run_once_before_install-packages-darwin.sh.tmpl b/run_once_before_install-packages-darwin.sh.tmpl index 000e1d4..712c27e 100644 --- a/run_once_before_install-packages-darwin.sh.tmpl +++ b/run_once_before_install-packages-darwin.sh.tmpl @@ -101,7 +101,7 @@ cask "vivaldi" cask "vlc" cask "zoom" cask "zotero" -{{ end -}} +{{ end }} EOF brew pin gcc From fa834e713c455ac2ce67ef873f4e7428b399b3b8 Mon Sep 17 00:00:00 2001 From: Marc Henry de Frahan Date: Sat, 27 Jan 2024 11:35:55 -0700 Subject: [PATCH 32/78] moving around --- run_once_before_install-packages-darwin.sh.tmpl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/run_once_before_install-packages-darwin.sh.tmpl b/run_once_before_install-packages-darwin.sh.tmpl index 712c27e..62b759d 100644 --- a/run_once_before_install-packages-darwin.sh.tmpl +++ b/run_once_before_install-packages-darwin.sh.tmpl @@ -3,8 +3,6 @@ brew bundle --no-lock --file=/dev/stdin < Date: Sat, 27 Jan 2024 11:39:22 -0700 Subject: [PATCH 33/78] and this --- run_once_before_install-packages-darwin.sh.tmpl | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/run_once_before_install-packages-darwin.sh.tmpl b/run_once_before_install-packages-darwin.sh.tmpl index 62b759d..19957fa 100644 --- a/run_once_before_install-packages-darwin.sh.tmpl +++ b/run_once_before_install-packages-darwin.sh.tmpl @@ -4,6 +4,7 @@ brew bundle --no-lock --file=/dev/stdin < Date: Sat, 27 Jan 2024 12:12:19 -0700 Subject: [PATCH 34/78] easier test --- run_once_after_install-tests.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/run_once_after_install-tests.sh b/run_once_after_install-tests.sh index e0d2d46..7ac31c7 100644 --- a/run_once_after_install-tests.sh +++ b/run_once_after_install-tests.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash -cmds=( "fzf" "poetry" "pyenv" "zoxide" ) +cmds=( "fzf" ) for cmd in "${cmds[@]}" do if [[ ! -x "$(command -v $cmd)" ]]; then From 38c2ea7da5eb36ba9c0c6ba74675065b308c5d47 Mon Sep 17 00:00:00 2001 From: Marc Henry de Frahan Date: Sat, 27 Jan 2024 12:18:56 -0700 Subject: [PATCH 35/78] add linux --- .github/workflows/ci.yml | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3182aa5..e772d73 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -14,16 +14,24 @@ concurrency: cancel-in-progress: true jobs: - OSX: - runs-on: macos-latest + Dotfiles: + runs-on: ${{matrix.os}} + strategy: + matrix: + os: [ubuntu-latest, macos-latest] + include: + - os: macos-latest + install_deps: brew install chezmoi + - os: ubuntu-latest + install_deps: sudo apt-get update && sudo apt-get install chezmoi steps: - name: Dependencies run: | - brew install chezmoi + ${{matrix.install_deps}} - name: Install run: | export BRANCH=${{ github.head_ref || github.ref_name }} echo $BRANCH chezmoi init https://github.com/marchdf/dotfiles.git --branch ${BRANCH} --promptBool test_machine=t,"Use ZSH_ROOT_DIR for tmux shell"=f --promptString email="" chezmoi data - chezmoi apply -v + chezmoi apply From f4b819b6c3f9c53abf2d73fbeb856c394a92407a Mon Sep 17 00:00:00 2001 From: Marc Henry de Frahan Date: Sat, 27 Jan 2024 12:23:41 -0700 Subject: [PATCH 36/78] try curl --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e772d73..105989a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -23,7 +23,7 @@ jobs: - os: macos-latest install_deps: brew install chezmoi - os: ubuntu-latest - install_deps: sudo apt-get update && sudo apt-get install chezmoi + install_deps: sudo apt-get update && sudo sh -c "$(curl -fsLS get.chezmoi.io)" steps: - name: Dependencies run: | From 7f67716ef0e356c194087d84f8d80c844fa141f8 Mon Sep 17 00:00:00 2001 From: Marc Henry de Frahan Date: Sat, 27 Jan 2024 12:35:01 -0700 Subject: [PATCH 37/78] better path --- .github/workflows/ci.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 105989a..71845ef 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -23,7 +23,8 @@ jobs: - os: macos-latest install_deps: brew install chezmoi - os: ubuntu-latest - install_deps: sudo apt-get update && sudo sh -c "$(curl -fsLS get.chezmoi.io)" + install_deps: sudo apt-get update && sh -c "$(curl -fsLS get.chezmoi.io)" -- -b $HOME/.local/bin && export PATH="${HOME}/.local/bin:$PATH" + steps: - name: Dependencies run: | From e203dae0bc23789b168009d2bd322d0d1d712e57 Mon Sep 17 00:00:00 2001 From: Marc Henry de Frahan Date: Sat, 27 Jan 2024 12:41:13 -0700 Subject: [PATCH 38/78] skip spack manager on test machine --- run_once_after_install-spack-packages-cluster.sh.tmpl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/run_once_after_install-spack-packages-cluster.sh.tmpl b/run_once_after_install-spack-packages-cluster.sh.tmpl index dc61b09..ce8ee14 100644 --- a/run_once_after_install-spack-packages-cluster.sh.tmpl +++ b/run_once_after_install-spack-packages-cluster.sh.tmpl @@ -1,4 +1,5 @@ -{{- if eq .chezmoi.os "linux" -}} +{{- if (and (eq .chezmoi.os "linux") (not .test_machine)) -}} + #!/usr/bin/env bash cmd() { From f590165f13f82e3890de164faab98c11d3540547 Mon Sep 17 00:00:00 2001 From: Marc Henry de Frahan Date: Sat, 27 Jan 2024 14:12:41 -0700 Subject: [PATCH 39/78] add fzf to linux --- .github/workflows/ci.yml | 1 - run_once_before_install-packages-linux.sh.tmpl | 5 +++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 71845ef..7045eb0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -32,7 +32,6 @@ jobs: - name: Install run: | export BRANCH=${{ github.head_ref || github.ref_name }} - echo $BRANCH chezmoi init https://github.com/marchdf/dotfiles.git --branch ${BRANCH} --promptBool test_machine=t,"Use ZSH_ROOT_DIR for tmux shell"=f --promptString email="" chezmoi data chezmoi apply diff --git a/run_once_before_install-packages-linux.sh.tmpl b/run_once_before_install-packages-linux.sh.tmpl index d77f777..fc5f996 100644 --- a/run_once_before_install-packages-linux.sh.tmpl +++ b/run_once_before_install-packages-linux.sh.tmpl @@ -5,4 +5,9 @@ if [[ ! -x "$(command -v pyenv)" ]]; then curl https://pyenv.run | bash fi +if [[ ! -x "$(command -v fzf)" ]]; then + git clone --depth 1 https://github.com/junegunn/fzf.git ~/.fzf + ~/.fzf/install --all +fi + {{ end -}} From 20df1045d2fe0beff11aef29ff95fe97df5f21ee Mon Sep 17 00:00:00 2001 From: Marc Henry de Frahan Date: Mon, 29 Jan 2024 09:02:43 -0700 Subject: [PATCH 40/78] remove tests --- .github/workflows/ci.yml | 3 +++ run_once_after_install-tests.sh | 10 ---------- 2 files changed, 3 insertions(+), 10 deletions(-) delete mode 100644 run_once_after_install-tests.sh diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7045eb0..2e4742c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -35,3 +35,6 @@ jobs: chezmoi init https://github.com/marchdf/dotfiles.git --branch ${BRANCH} --promptBool test_machine=t,"Use ZSH_ROOT_DIR for tmux shell"=f --promptString email="" chezmoi data chezmoi apply + - name: Text zsh + run: | + time zsh -i -c exit diff --git a/run_once_after_install-tests.sh b/run_once_after_install-tests.sh deleted file mode 100644 index 7ac31c7..0000000 --- a/run_once_after_install-tests.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/usr/bin/env bash - -cmds=( "fzf" ) -for cmd in "${cmds[@]}" -do - if [[ ! -x "$(command -v $cmd)" ]]; then - echo "$cmd was not installed!" - exit 1 - fi -done From 7ba7975af036ae7ea0a220a4f89a83f90bfd7660 Mon Sep 17 00:00:00 2001 From: Marc Henry de Frahan Date: Mon, 29 Jan 2024 20:33:50 -0700 Subject: [PATCH 41/78] install zsh and ohmyzsh --- .github/workflows/ci.yml | 3 +-- run_once_before_install-packages-cli.sh | 4 ++++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2e4742c..4dc27dc 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -23,8 +23,7 @@ jobs: - os: macos-latest install_deps: brew install chezmoi - os: ubuntu-latest - install_deps: sudo apt-get update && sh -c "$(curl -fsLS get.chezmoi.io)" -- -b $HOME/.local/bin && export PATH="${HOME}/.local/bin:$PATH" - + install_deps: sudo apt-get update && sudo apt install zsh -y && sh -c "$(curl -fsLS get.chezmoi.io)" -- -b $HOME/.local/bin && export PATH="${HOME}/.local/bin:$PATH" steps: - name: Dependencies run: | diff --git a/run_once_before_install-packages-cli.sh b/run_once_before_install-packages-cli.sh index af5ca90..8226e0e 100644 --- a/run_once_before_install-packages-cli.sh +++ b/run_once_before_install-packages-cli.sh @@ -1,5 +1,9 @@ #!/usr/bin/env bash +if [ ! -d "${HOME}/.oh-my-zsh" ]; then + sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" +fi + if [[ ! -x "$(command -v poetry)" ]]; then curl -sSL https://install.python-poetry.org | POETRY_VERSION=1.7.0 POETRY_HOME=${HOME}/.poetry python3 - fi From 967f26334abb0e9593c13eeb250ce252a06029be Mon Sep 17 00:00:00 2001 From: Marc Henry de Frahan Date: Tue, 30 Jan 2024 10:19:49 -0700 Subject: [PATCH 42/78] try this --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4dc27dc..e67adc8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -30,8 +30,8 @@ jobs: ${{matrix.install_deps}} - name: Install run: | - export BRANCH=${{ github.head_ref || github.ref_name }} - chezmoi init https://github.com/marchdf/dotfiles.git --branch ${BRANCH} --promptBool test_machine=t,"Use ZSH_ROOT_DIR for tmux shell"=f --promptString email="" + export CHEZMOI_BRANCH=${{ github.head_ref || github.ref_name }} + chezmoi init https://github.com/marchdf/dotfiles.git --branch ${CHEZMOI_BRANCH} --promptBool test_machine=t,"Use ZSH_ROOT_DIR for tmux shell"=f --promptString email="" chezmoi data chezmoi apply - name: Text zsh From 64d3c44acd19d9f34bc4c5e5637dab4a27cfe6b7 Mon Sep 17 00:00:00 2001 From: Marc Henry de Frahan Date: Tue, 30 Jan 2024 10:24:15 -0700 Subject: [PATCH 43/78] add this --- .github/workflows/ci.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e67adc8..8b51fb6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -34,6 +34,9 @@ jobs: chezmoi init https://github.com/marchdf/dotfiles.git --branch ${CHEZMOI_BRANCH} --promptBool test_machine=t,"Use ZSH_ROOT_DIR for tmux shell"=f --promptString email="" chezmoi data chezmoi apply - - name: Text zsh + - name: Cold start zsh + run: | + time zsh -i -c exit + - name: Warm start zsh run: | time zsh -i -c exit From a4ce57e3f62e1284e8d7c43b0be0ad86dddef2ed Mon Sep 17 00:00:00 2001 From: Marc Henry de Frahan Date: Tue, 30 Jan 2024 10:28:10 -0700 Subject: [PATCH 44/78] don't do spack packages --- .chezmoi.toml.tmpl | 3 ++- run_once_after_install-spack-packages-cluster.sh.tmpl | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.chezmoi.toml.tmpl b/.chezmoi.toml.tmpl index 2faf42d..6273ff4 100644 --- a/.chezmoi.toml.tmpl +++ b/.chezmoi.toml.tmpl @@ -9,4 +9,5 @@ [data] use_zsh_root_dir = {{ $use_zsh_root_dir }} email = {{ $email | quote }} - test_machine = {{ $test_machine }} \ No newline at end of file + test_machine = {{ $test_machine }} + spack_packages = false \ No newline at end of file diff --git a/run_once_after_install-spack-packages-cluster.sh.tmpl b/run_once_after_install-spack-packages-cluster.sh.tmpl index ce8ee14..fd77c26 100644 --- a/run_once_after_install-spack-packages-cluster.sh.tmpl +++ b/run_once_after_install-spack-packages-cluster.sh.tmpl @@ -1,4 +1,4 @@ -{{- if (and (eq .chezmoi.os "linux") (not .test_machine)) -}} +{{- if (and (eq .chezmoi.os "linux") (.spack_packages)) -}} #!/usr/bin/env bash From b6224590d272b73577d2533d519057f8fb960bd4 Mon Sep 17 00:00:00 2001 From: Marc Henry de Frahan Date: Tue, 30 Jan 2024 14:28:42 -0700 Subject: [PATCH 45/78] move emacs to zinit --- dot_zshrc | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/dot_zshrc b/dot_zshrc index 6f8bf04..b325893 100644 --- a/dot_zshrc +++ b/dot_zshrc @@ -38,6 +38,13 @@ zinit light-mode for \ zinit ice lucid depth"1" zinit light romkatv/powerlevel10k +# you can wait this if you use zinit with my aliases because they need emacs_plugin_blah variable +# otherwise you can't wait this +zinit lucid light-mode \ + atclone'wget https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/plugins/emacs/emacsclient.sh; chmod +x emacsclient.sh' \ + atpull'%atclone' \ + for "OMZP::emacs" + zinit wait lucid light-mode for \ has'fzf' "OMZP::fzf" \ has'fzf' @Aloxaf/fzf-tab \ @@ -59,7 +66,7 @@ CORRECT_IGNORE_FILE='.*' # Custom plugins may be added to ~/.oh-my-zsh/custom/plugins/ # Example format: plugins=(rails git textmate ruby lighthouse) # Add wisely, as too many plugins slow down shell startup. -plugins=(emacs) +plugins=() source $ZSH/oh-my-zsh.sh From bb28dedba8db7328c7acbad7b7ef53c0aae3186d Mon Sep 17 00:00:00 2001 From: Marc Henry de Frahan Date: Wed, 31 Jan 2024 09:48:34 -0700 Subject: [PATCH 46/78] add gui emacs alias --- dot_oh-my-zsh/custom/aliases.zsh | 1 + 1 file changed, 1 insertion(+) diff --git a/dot_oh-my-zsh/custom/aliases.zsh b/dot_oh-my-zsh/custom/aliases.zsh index 4125a49..c6e1646 100644 --- a/dot_oh-my-zsh/custom/aliases.zsh +++ b/dot_oh-my-zsh/custom/aliases.zsh @@ -5,6 +5,7 @@ alias ..2="cd ../.." alias ..3="cd ../../.." alias ..4="cd ../../../.." alias ..5="cd ../../../../.." +alias ge="$EMACS_PLUGIN_LAUNCHER --no-wait" alias e="$EMACS_PLUGIN_LAUNCHER -nw" alias ek='emacsclient -e "(kill-emacs)"' alias rmeps="rm *.eps" From 181d07d7e7d5843360ae4cf2b16bead5d55522ba Mon Sep 17 00:00:00 2001 From: Marc Henry de Frahan Date: Wed, 31 Jan 2024 11:49:57 -0700 Subject: [PATCH 47/78] add tree --- run_once_before_install-packages-darwin.sh.tmpl | 1 + 1 file changed, 1 insertion(+) diff --git a/run_once_before_install-packages-darwin.sh.tmpl b/run_once_before_install-packages-darwin.sh.tmpl index 19957fa..61b8677 100644 --- a/run_once_before_install-packages-darwin.sh.tmpl +++ b/run_once_before_install-packages-darwin.sh.tmpl @@ -69,6 +69,7 @@ brew "taglib" brew "terminal-notifier" brew "tldr" brew "tmux" +brew "tree" brew "tree-sitter" brew "vorbis-tools" brew "wdiff" From 30e207bb54616b45ae8d2a9e3d4536783d5ef558 Mon Sep 17 00:00:00 2001 From: Marc Henry de Frahan Date: Thu, 1 Feb 2024 09:18:29 -0700 Subject: [PATCH 48/78] consolidate some functions into a plugin --- .chezmoi.toml.tmpl | 14 +- .chezmoiignore | 1 - .../plugins/personal/personal.plugin.zsh.tmpl | 265 ++++++++++++++++++ dot_oh-my-zsh/custom/aliases.zsh | 47 ---- dot_oh-my-zsh/custom/functions.zsh | 69 ----- dot_oh-my-zsh/custom/functions_nrel_hpc.zsh | 65 ----- dot_oh-my-zsh/custom/functions_olcf_hpc.zsh | 20 -- .../custom/iterm2_ssh_switch_tab_color.zsh | 43 --- dot_zshrc | 2 + 9 files changed, 280 insertions(+), 246 deletions(-) create mode 100644 dot_local/share/zinit/plugins/personal/personal.plugin.zsh.tmpl delete mode 100644 dot_oh-my-zsh/custom/aliases.zsh delete mode 100644 dot_oh-my-zsh/custom/functions.zsh delete mode 100644 dot_oh-my-zsh/custom/functions_nrel_hpc.zsh delete mode 100644 dot_oh-my-zsh/custom/functions_olcf_hpc.zsh delete mode 100644 dot_oh-my-zsh/custom/iterm2_ssh_switch_tab_color.zsh diff --git a/.chezmoi.toml.tmpl b/.chezmoi.toml.tmpl index 6273ff4..82ea418 100644 --- a/.chezmoi.toml.tmpl +++ b/.chezmoi.toml.tmpl @@ -6,8 +6,20 @@ {{ $email := promptStringOnce . "email" "email" -}} {{ $test_machine := promptBoolOnce . "test_machine" "test_machine" }} +{{ $nrel_hpc := false -}} +{{- if or (eq (env "NREL_CLUSTER") "eagle") (eq (env "NREL_CLUSTER") "ellis") -}} +{{ $nrel_hpc = true -}} +{{- end -}} + +{{ $ornl_hpc := false -}} +{{- if eq (env "LMOD_SYSTEM_NAME") "frontier" -}} +{{ $ornl_hpc = true -}} +{{- end -}} + [data] use_zsh_root_dir = {{ $use_zsh_root_dir }} email = {{ $email | quote }} test_machine = {{ $test_machine }} - spack_packages = false \ No newline at end of file + spack_packages = false + nrel_hpc = {{ $nrel_hpc }} + ornl_hpc = {{ $ornl_hpc }} \ No newline at end of file diff --git a/.chezmoiignore b/.chezmoiignore index 9abcd84..7b36f1b 100644 --- a/.chezmoiignore +++ b/.chezmoiignore @@ -7,7 +7,6 @@ terminal-app .config/karabiner .config/iterm2 .hammerspoon -.oh-my-zsh/custom/iterm2_ssh_switch_tab_color.zsh .vscode bin/keyremap.sh Library diff --git a/dot_local/share/zinit/plugins/personal/personal.plugin.zsh.tmpl b/dot_local/share/zinit/plugins/personal/personal.plugin.zsh.tmpl new file mode 100644 index 0000000..12f3829 --- /dev/null +++ b/dot_local/share/zinit/plugins/personal/personal.plugin.zsh.tmpl @@ -0,0 +1,265 @@ +# -*- mode: sh; sh-indentation: 4; indent-tabs-mode: nil; sh-basic-offset: 4; -*- + +# Copyright (c) 2024 Marc Henry de Frahan + +# According to the Zsh Plugin Standard: +# https://zdharma-continuum.github.io/Zsh-100-Commits-Club/Zsh-Plugin-Standard.html + +0=${${ZERO:-${0:#$ZSH_ARGZERO}}:-${(%):-%N}} +0=${${(M)0:#/*}:-$PWD/$0} + +# Then ${0:h} to get plugin's directory + +if [[ ${zsh_loaded_plugins[-1]} != */personal && -z ${fpath[(r)${0:h}]} ]] { + fpath+=( "${0:h}" ) +} + +# Standard hash for plugins, to not pollute the namespace +typeset -gA Plugins +Plugins[PERSONAL_DIR]="${0:h}" + +# Aliases + +alias ..="cd .." +alias ..2="cd ../.." +alias ..3="cd ../../.." +alias ..4="cd ../../../.." +alias ..5="cd ../../../../.." +alias ge="$EMACS_PLUGIN_LAUNCHER --no-wait" +alias e="$EMACS_PLUGIN_LAUNCHER -nw" +alias ek='emacsclient -e "(kill-emacs)"' +alias rmeps="rm *.eps" +alias rmpng="rm *.png" +alias rmpdf="rm -i *.pdf" +alias sshot="import ~/Desktop/screenshot.jpg" # screenshot (pick area to grab) +alias empty_space="printf ''\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n''" +alias lt="ls -lt" + +# Improving CLI +if [[ -x "$(command -v htop)" ]]; then alias top="htop"; fi +if [[ -x "$(command -v bat)" ]]; then alias cat="bat"; fi +if [[ -x "$(command -v prettyping)" ]]; then alias ping="prettyping"; fi +if [[ -x "$(command -v tldr)" ]]; then alias help="tldr"; fi + +# Weather using https://github.com/chubin/wttr.in +alias weather="curl wttr.in/\?m" + +# upgrade all python packages with pip. +# from http://mikegrouchy.com/blog/2014/06/pro-tip-pip-upgrade-all-python-packages.html +# periodically check this to make sure that pip didn't add this new feature +alias pip2_upgrade_all="pip2 freeze --local | grep -v '^\-e' | cut -d = -f 1 | xargs pip2 install -U" +alias pip3_upgrade_all="pip3 freeze --local | grep -v '^\-e' | cut -d = -f 1 | xargs pip3 install -U" + +# Mass renaming of files +# e.g. mmv *.dat *.dat_old +autoload -U zmv +alias mmv="noglob zmv -W" + +# Cluster aliases +if [[ -x "$(command -v qstat)" ]]; then + alias qs="qstat -u $USER"; + alias job_node_ids="qstat -u $USER -f | grep -e 'Job\ Id\|exec_host\|Job_Name'" +fi + +if [[ -x "$(command -v squeue)" ]]; then + alias qs="squeue -u $USER -o '%12i %.9P %20j %.2t %.10M %.6D %r %N'" + alias qnodes="sinfo -o '%24P %.5a %.12l %.16F'" +fi + +# Functions + +# print each directory of argument $PATH on its own line +function prettypath() { echo ${1-$PATH} | sed 's/:/\n/g'; } + +# Calls the teatimer script +function tt() { ~/bin/teatimer.sh "$@" &} + +# Calls the pdf2eps script +function pdf2eps() { ~/bin/pdf2eps.sh "$@" &} + +# refresh directory (if the directory was deleted from underneath us +# and we are still in it, try to re-cd to the directory) +function recd() { cd `pwd`; } + +# Diff two files using emacs ediff +# From: https://defunitive.wordpress.com/2011/07/23/invoking-emacs-ediff-from-the-command-line/ +function ediff() { + if [ "X${2}" = "X" ]; then + echo "USAGE: ediff " + else + # The --eval flag takes lisp code and evaluates it with emacs + e --eval "(ediff-files \"$1\" \"$2\")" + fi +} + +# Load spack environment if you want it. I do this instead of loading +# it by default because it would slow down terminal startup time +function load_spack(){ + if [ -d "$SPACK_DIR" ]; then + export SPACK_ROOT=${SPACK_DIR} + . ${SPACK_ROOT}/share/spack/setup-env.sh + fi +} + +# Grep through all python scrips in home directory +function grep_python() { + grep -r --include=\*.py --exclude-dir=.virtualenvs --exclude-dir=.emacs.d --exclude-dir=spack --exclude-dir=.oh-my-zsh "${1}" ${HOME} +} + +# runs TensorBoard with a comma-separated list of all provided logdirs +# usage: multitb LOGDIR [LOGDIR...] +# from: https://github.com/tensorflow/tensorboard/issues/179 +multitb() ( + set -eu + if [ $# -eq 0 ]; then + printf >&2 'fatal: provide at least one logdir\n' + return 1 + fi + tmpdir="$(mktemp -d)" + for arg; do + case "${arg}" in + /*) ln -s "${arg}" "${tmpdir}/" ;; + *) ln -s "${PWD}/${arg}" "${tmpdir}/" ;; + esac + done + exit_code=0 + \command ls -l "${tmpdir}" + printf 'tensorboard --logdir %s\n' "${tmpdir}" + tensorboard --logdir "${tmpdir}" || exit_code=$? + # This really should be 'find -H "${tmpdir}" -type l -delete` to + # account for logdirs whose names start with `.`, which should + # behave correctly on any POSIX system, but it is much more clear + # that the version below cannot under any circumstances delete the + # underlying data (e.g., with non-POSIX-compliant `find`(1)). + rm "${tmpdir}"/* + rmdir "${tmpdir}" + return "${exit_code}" +) + +{{- if eq .chezmoi.os "darwin" }} +# iTerm2 window/tab color commands +# Requires iTerm2 >= Build 1.0.0.20110804 +# http://code.google.com/p/iterm2/wiki/ProprietaryEscapeCodes +# Forked from: https://gist.github.com/wadey/1140259 +tab-color() { + echo -ne "\033]6;1;bg;red;brightness;$1\a" + echo -ne "\033]6;1;bg;green;brightness;$2\a" + echo -ne "\033]6;1;bg;blue;brightness;$3\a" +} +tab-reset() { + echo -ne "\033]6;1;bg;*;default\a" +} + +# Change the color of the tab when using SSH +# reset the color after the connection closes +color-ssh() { + if [[ -n "$ITERM_SESSION_ID" ]]; then + trap "tab-reset" INT EXIT + if [[ "$*" =~ "navier|other_*_machine" ]]; then + tab-color 24 90 169 + elif [[ "$*" =~ "cori|edison" ]]; then + tab-color 244 125 35 + elif [[ "$*" =~ "machine1a|machine1b" ]]; then + tab-color 102 44 155 + elif [[ "$*" =~ "machine2a|machine2b" ]]; then + tab-color 162 29 33 + elif [[ "$*" =~ "machine3a|machine3b" ]]; then + tab-color 180 56 148 + else + tab-color 0 140 72 + fi + fi + ssh $* +} +compdef _ssh color-ssh=ssh + +alias ssh=color-ssh + +{{- end }} + +{{- if .nrel_hpc }} +# Custom aliases for NREL HPC machines +function load_custom_modules { + + { + module purge + module load gcc + module load mpt + module load binutils + module load bzip2 + module load cmake + module load ffmpeg/4.2.2 + module load git + module load gnutls + module load htop + module load image-magick + module load libffi + module load libtool + module load openssl + module load python/3.7.7 + module load py-setuptools-scm + module load sqlite + module load texlive + module load tmux + + module load emacs/28.2 + module load ccls + } &> /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 +} + +function pyenv_python_install(){ + module load gcc + module load mpt + module load binutils + module load git + module load gnutls + module load libtool + module load texlive + module load bzip2 + module load libffi + module load openssl + module load sqlite + export LDFLAGS="-L${OPENSSL_ROOT_DIR}/lib -L${LIBFFI_ROOT_DIR}/lib64 -L${BZIP2_ROOT_DIR}/lib -L${SQLITE_ROOT_DIR}/lib" + export CPPFLAGS="-I${OPENSSL_ROOT_DIR}/include -I${LIBFFI_ROOT_DIR}/include -I${BZIP2_ROOT_DIR}/include -I${SQLITE_ROOT_DIR}/include" + export PYTHON_CONFIGURE_OPTS="--enable-optimizations --with-lto" + export PYTHON_CFLAGS="-mtune=native" + pyenv install +} +{{ end }} + +{{- if .ornl_hpc }} +# Custom aliases for OLCF HPC machines +function load_custom_modules { + { + module load DefApps-spi/default + module load cmake + module load emacs + module load go + module load htop + module load imagemagick + module load tmux + + module load cray-python + + } &> /dev/null +} +{{ end }} + +# Use alternate vim marks [[[ and ]]] as the original ones can +# confuse nested substitutions, e.g.: ${${${VAR}}} + +# vim:ft=zsh:tw=80:sw=4:sts=4:et:foldmarker=[[[,]]] diff --git a/dot_oh-my-zsh/custom/aliases.zsh b/dot_oh-my-zsh/custom/aliases.zsh deleted file mode 100644 index c6e1646..0000000 --- a/dot_oh-my-zsh/custom/aliases.zsh +++ /dev/null @@ -1,47 +0,0 @@ -# These are my general aliases - -alias ..="cd .." -alias ..2="cd ../.." -alias ..3="cd ../../.." -alias ..4="cd ../../../.." -alias ..5="cd ../../../../.." -alias ge="$EMACS_PLUGIN_LAUNCHER --no-wait" -alias e="$EMACS_PLUGIN_LAUNCHER -nw" -alias ek='emacsclient -e "(kill-emacs)"' -alias rmeps="rm *.eps" -alias rmpng="rm *.png" -alias rmpdf="rm -i *.pdf" -alias sshot="import ~/Desktop/screenshot.jpg" # screenshot (pick area to grab) -alias empty_space="printf ''\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n''" -alias lt="ls -lt" - -# Improving CLI -if [[ -x "$(command -v htop)" ]]; then alias top="htop"; fi -if [[ -x "$(command -v bat)" ]]; then alias cat="bat"; fi -if [[ -x "$(command -v prettyping)" ]]; then alias ping="prettyping"; fi -if [[ -x "$(command -v tldr)" ]]; then alias help="tldr"; fi - -# Weather using https://github.com/chubin/wttr.in -alias weather="curl wttr.in/\?m" - -# upgrade all python packages with pip. -# from http://mikegrouchy.com/blog/2014/06/pro-tip-pip-upgrade-all-python-packages.html -# periodically check this to make sure that pip didn't add this new feature -alias pip2_upgrade_all="pip2 freeze --local | grep -v '^\-e' | cut -d = -f 1 | xargs pip2 install -U" -alias pip3_upgrade_all="pip3 freeze --local | grep -v '^\-e' | cut -d = -f 1 | xargs pip3 install -U" - -# Mass renaming of files -# e.g. mmv *.dat *.dat_old -autoload -U zmv -alias mmv="noglob zmv -W" - -# Cluster aliases -if [[ -x "$(command -v qstat)" ]]; then - alias qs="qstat -u $USER"; - alias job_node_ids="qstat -u $USER -f | grep -e 'Job\ Id\|exec_host\|Job_Name'" -fi - -if [[ -x "$(command -v squeue)" ]]; then - alias qs="squeue -u $USER -o '%12i %.9P %20j %.2t %.10M %.6D %r %N'" - alias qnodes="sinfo -o '%24P %.5a %.12l %.16F'" -fi diff --git a/dot_oh-my-zsh/custom/functions.zsh b/dot_oh-my-zsh/custom/functions.zsh deleted file mode 100644 index fc37e29..0000000 --- a/dot_oh-my-zsh/custom/functions.zsh +++ /dev/null @@ -1,69 +0,0 @@ -# These are my custom functions - -# print each directory of argument $PATH on its own line -function prettypath() { echo ${1-$PATH} | sed 's/:/\n/g'; } - -# Calls the teatimer script -function tt() { ~/bin/teatimer.sh "$@" &} - -# Calls the pdf2eps script -function pdf2eps() { ~/bin/pdf2eps.sh "$@" &} - -# refresh directory (if the directory was deleted from underneath us -# and we are still in it, try to re-cd to the directory) -function recd() { cd `pwd`; } - -# Diff two files using emacs ediff -# From: https://defunitive.wordpress.com/2011/07/23/invoking-emacs-ediff-from-the-command-line/ -function ediff() { - if [ "X${2}" = "X" ]; then - echo "USAGE: ediff " - else - # The --eval flag takes lisp code and evaluates it with emacs - e --eval "(ediff-files \"$1\" \"$2\")" - fi -} - -# Load spack environment if you want it. I do this instead of loading -# it by default because it would slow down terminal startup time -function load_spack(){ - if [ -d "$SPACK_DIR" ]; then - export SPACK_ROOT=${SPACK_DIR} - . ${SPACK_ROOT}/share/spack/setup-env.sh - fi -} - -# Grep through all python scrips in home directory -function grep_python() { - grep -r --include=\*.py --exclude-dir=.virtualenvs --exclude-dir=.emacs.d --exclude-dir=spack --exclude-dir=.oh-my-zsh "${1}" ${HOME} -} - -# runs TensorBoard with a comma-separated list of all provided logdirs -# usage: multitb LOGDIR [LOGDIR...] -# from: https://github.com/tensorflow/tensorboard/issues/179 -multitb() ( - set -eu - if [ $# -eq 0 ]; then - printf >&2 'fatal: provide at least one logdir\n' - return 1 - fi - tmpdir="$(mktemp -d)" - for arg; do - case "${arg}" in - /*) ln -s "${arg}" "${tmpdir}/" ;; - *) ln -s "${PWD}/${arg}" "${tmpdir}/" ;; - esac - done - exit_code=0 - \command ls -l "${tmpdir}" - printf 'tensorboard --logdir %s\n' "${tmpdir}" - tensorboard --logdir "${tmpdir}" || exit_code=$? - # This really should be 'find -H "${tmpdir}" -type l -delete` to - # account for logdirs whose names start with `.`, which should - # behave correctly on any POSIX system, but it is much more clear - # that the version below cannot under any circumstances delete the - # underlying data (e.g., with non-POSIX-compliant `find`(1)). - rm "${tmpdir}"/* - rmdir "${tmpdir}" - return "${exit_code}" -) diff --git a/dot_oh-my-zsh/custom/functions_nrel_hpc.zsh b/dot_oh-my-zsh/custom/functions_nrel_hpc.zsh deleted file mode 100644 index 0d8a667..0000000 --- a/dot_oh-my-zsh/custom/functions_nrel_hpc.zsh +++ /dev/null @@ -1,65 +0,0 @@ -# These are my custom aliases for my NREL HPC machines -if [ "${NREL_CLUSTER}" = "eagle" ] || [ "${NREL_CLUSTER}" = "ellis" ]; then - - function load_custom_modules { - - { - module purge - module load gcc - module load mpt - module load binutils - module load bzip2 - module load cmake - module load ffmpeg/4.2.2 - module load git - module load gnutls - module load htop - module load image-magick - module load libffi - module load libtool - module load openssl - module load python/3.7.7 - module load py-setuptools-scm - module load sqlite - module load texlive - module load tmux - - module load emacs/28.2 - module load ccls - } &> /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 - } - - function pyenv_python_install(){ - module load gcc - module load mpt - module load binutils - module load git - module load gnutls - module load libtool - module load texlive - module load bzip2 - module load libffi - module load openssl - module load sqlite - export LDFLAGS="-L${OPENSSL_ROOT_DIR}/lib -L${LIBFFI_ROOT_DIR}/lib64 -L${BZIP2_ROOT_DIR}/lib -L${SQLITE_ROOT_DIR}/lib" - export CPPFLAGS="-I${OPENSSL_ROOT_DIR}/include -I${LIBFFI_ROOT_DIR}/include -I${BZIP2_ROOT_DIR}/include -I${SQLITE_ROOT_DIR}/include" - export PYTHON_CONFIGURE_OPTS="--enable-optimizations --with-lto" - export PYTHON_CFLAGS="-mtune=native" - pyenv install - } - -fi diff --git a/dot_oh-my-zsh/custom/functions_olcf_hpc.zsh b/dot_oh-my-zsh/custom/functions_olcf_hpc.zsh deleted file mode 100644 index 81785d7..0000000 --- a/dot_oh-my-zsh/custom/functions_olcf_hpc.zsh +++ /dev/null @@ -1,20 +0,0 @@ -# These are my custom aliases for my OLCF HPC machines -if [ "${LMOD_SYSTEM_NAME}" = "frontier" ]; then - - function load_custom_modules { - - { - module load DefApps-spi/default - module load cmake - module load emacs - module load go - module load htop - module load imagemagick - module load tmux - - module load cray-python - - } &> /dev/null - } - -fi diff --git a/dot_oh-my-zsh/custom/iterm2_ssh_switch_tab_color.zsh b/dot_oh-my-zsh/custom/iterm2_ssh_switch_tab_color.zsh deleted file mode 100644 index 10a6d6a..0000000 --- a/dot_oh-my-zsh/custom/iterm2_ssh_switch_tab_color.zsh +++ /dev/null @@ -1,43 +0,0 @@ -#Usage: -# source iterm2.zsh -# -# Forked from: https://gist.github.com/wadey/1140259 -# - - -# iTerm2 window/tab color commands -# Requires iTerm2 >= Build 1.0.0.20110804 -# http://code.google.com/p/iterm2/wiki/ProprietaryEscapeCodes -tab-color() { - echo -ne "\033]6;1;bg;red;brightness;$1\a" - echo -ne "\033]6;1;bg;green;brightness;$2\a" - echo -ne "\033]6;1;bg;blue;brightness;$3\a" -} -tab-reset() { - echo -ne "\033]6;1;bg;*;default\a" -} - -# Change the color of the tab when using SSH -# reset the color after the connection closes -color-ssh() { - if [[ -n "$ITERM_SESSION_ID" ]]; then - trap "tab-reset" INT EXIT - if [[ "$*" =~ "navier|other_*_machine" ]]; then - tab-color 24 90 169 - elif [[ "$*" =~ "cori|edison" ]]; then - tab-color 244 125 35 - elif [[ "$*" =~ "machine1a|machine1b" ]]; then - tab-color 102 44 155 - elif [[ "$*" =~ "machine2a|machine2b" ]]; then - tab-color 162 29 33 - elif [[ "$*" =~ "machine3a|machine3b" ]]; then - tab-color 180 56 148 - else - tab-color 0 140 72 - fi - fi - ssh $* -} -compdef _ssh color-ssh=ssh - -alias ssh=color-ssh diff --git a/dot_zshrc b/dot_zshrc index b325893..39babd2 100644 --- a/dot_zshrc +++ b/dot_zshrc @@ -54,6 +54,8 @@ zinit wait lucid light-mode for \ "OMZP::tmux" \ "OMZP::zoxide" +zinit wait lucid light-mode for "personal" + # Path to your oh-my-zsh installation. export ZSH=$HOME/.oh-my-zsh From 1ea8a2133f7c91dd4095077626e7efb6d353d89b Mon Sep 17 00:00:00 2001 From: Marc Henry de Frahan Date: Thu, 1 Feb 2024 11:15:22 -0700 Subject: [PATCH 49/78] conda update --- conda-env/environment.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/conda-env/environment.yml b/conda-env/environment.yml index b69c294..1701b1f 100644 --- a/conda-env/environment.yml +++ b/conda-env/environment.yml @@ -7,7 +7,7 @@ channels: - conda-forge - defaults dependencies: - - python=3.10 + - python=3.11 - black - ipython - line_profiler @@ -22,6 +22,5 @@ dependencies: - seaborn - snakeviz - sphinx - - toml - yt prefix: /home/mhenryde/miniconda3/envs/main From d85bd9f0a03cfd999d45493b1e0f77c241b6241e Mon Sep 17 00:00:00 2001 From: Marc Henry de Frahan Date: Thu, 1 Feb 2024 13:13:27 -0700 Subject: [PATCH 50/78] fix ediff --- dot_local/share/zinit/plugins/personal/personal.plugin.zsh.tmpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dot_local/share/zinit/plugins/personal/personal.plugin.zsh.tmpl b/dot_local/share/zinit/plugins/personal/personal.plugin.zsh.tmpl index 12f3829..6c9748c 100644 --- a/dot_local/share/zinit/plugins/personal/personal.plugin.zsh.tmpl +++ b/dot_local/share/zinit/plugins/personal/personal.plugin.zsh.tmpl @@ -88,7 +88,7 @@ function ediff() { echo "USAGE: ediff " else # The --eval flag takes lisp code and evaluates it with emacs - e --eval "(ediff-files \"$1\" \"$2\")" + "$EMACS_PLUGIN_LAUNCHER" -nw --eval "(ediff-files \"$1\" \"$2\")" fi } From d27dbe1b41097ad3beff9b0bd29169848953d96b Mon Sep 17 00:00:00 2001 From: Marc Henry de Frahan Date: Thu, 1 Feb 2024 13:33:14 -0700 Subject: [PATCH 51/78] update for eagle --- .../zinit/plugins/hpc/hpc.plugin.zsh.tmpl | 130 ++++++++++++++++++ .../plugins/personal/personal.plugin.zsh.tmpl | 82 ----------- dot_zshenv.tmpl | 31 ----- dot_zshrc | 8 +- 4 files changed, 134 insertions(+), 117 deletions(-) create mode 100644 dot_local/share/zinit/plugins/hpc/hpc.plugin.zsh.tmpl diff --git a/dot_local/share/zinit/plugins/hpc/hpc.plugin.zsh.tmpl b/dot_local/share/zinit/plugins/hpc/hpc.plugin.zsh.tmpl new file mode 100644 index 0000000..98290ea --- /dev/null +++ b/dot_local/share/zinit/plugins/hpc/hpc.plugin.zsh.tmpl @@ -0,0 +1,130 @@ +# -*- mode: sh; sh-indentation: 4; indent-tabs-mode: nil; sh-basic-offset: 4; -*- + +# Copyright (c) 2024 Marc Henry de Frahan + +# According to the Zsh Plugin Standard: +# https://zdharma-continuum.github.io/Zsh-100-Commits-Club/Zsh-Plugin-Standard.html + +0=${${ZERO:-${0:#$ZSH_ARGZERO}}:-${(%):-%N}} +0=${${(M)0:#/*}:-$PWD/$0} + +# Then ${0:h} to get hpc's directory + +if [[ ${zsh_loaded_plugins[-1]} != */personal && -z ${fpath[(r)${0:h}]} ]] { + fpath+=( "${0:h}" ) +} + +# Standard hash for plugins, to not pollute the namespace +typeset -gA Plugins +Plugins[PERSONAL_DIR]="${0:h}" + +{{- if .nrel_hpc }} +# Custom for NREL HPC machines + +# Set scratch +if [ -d "/scratch/${USER}" ]; then + export SCRATCH="/scratch/${USER}" +fi + +# Set the modules +if [ "${NREL_CLUSTER}" = "eagle" ]; then + source /nopt/nrel/utils/lmod/lmod/init/zsh + source /nopt/nrel/ecom/hpacf/env.sh + module use ${HOME}/modules/linux-centos7-skylake_avx512/gcc-9.3.0 + export TMPDIR=${SCRATCH}/.tmp +elif [ "${NREL_CLUSTER}" = "ellis" ]; then + MODULES_DATE=2023-05-11 + source /data/ssd1/software/${MODULES_DATE}/env.sh + export TMPDIR=/data/ssd1/home/${USER}/.tmp +fi + +umask u=rwx,go=rx,o=rx + +function load_custom_modules { + + { + module purge + module load gcc + module load mpt + module load binutils + module load bzip2 + module load cmake + module load ffmpeg/4.2.2 + module load git + module load gnutls + module load htop + module load image-magick + module load libffi + module load libtool + module load openssl + module load python/3.7.7 + module load py-setuptools-scm + module load sqlite + module load texlive + module load tmux + + module load emacs/28.2 + module load ccls + } &> /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 +} + +function pyenv_python_install(){ + module load gcc + module load mpt + module load binutils + module load git + module load gnutls + module load libtool + module load texlive + module load bzip2 + module load libffi + module load openssl + module load sqlite + export LDFLAGS="-L${OPENSSL_ROOT_DIR}/lib -L${LIBFFI_ROOT_DIR}/lib64 -L${BZIP2_ROOT_DIR}/lib -L${SQLITE_ROOT_DIR}/lib" + export CPPFLAGS="-I${OPENSSL_ROOT_DIR}/include -I${LIBFFI_ROOT_DIR}/include -I${BZIP2_ROOT_DIR}/include -I${SQLITE_ROOT_DIR}/include" + export PYTHON_CONFIGURE_OPTS="--enable-optimizations --with-lto" + export PYTHON_CFLAGS="-mtune=native" + pyenv install +} +{{ end }} + +{{- if .ornl_hpc }} +# Custom for OLCF HPC machines +function load_custom_modules { + { + module load DefApps-spi/default + module load cmake + module load emacs + module load go + module load htop + module load imagemagick + module load tmux + + module load cray-python + + } &> /dev/null +} +{{ end }} + +{{- if or (.nrel_hpc) (.ornl_hpc) }} +load_custom_modules +{{ end }} + +# Use alternate vim marks [[[ and ]]] as the original ones can +# confuse nested substitutions, e.g.: ${${${VAR}}} + +# vim:ft=zsh:tw=80:sw=4:sts=4:et:foldmarker=[[[,]]] diff --git a/dot_local/share/zinit/plugins/personal/personal.plugin.zsh.tmpl b/dot_local/share/zinit/plugins/personal/personal.plugin.zsh.tmpl index 6c9748c..cf91ad3 100644 --- a/dot_local/share/zinit/plugins/personal/personal.plugin.zsh.tmpl +++ b/dot_local/share/zinit/plugins/personal/personal.plugin.zsh.tmpl @@ -177,88 +177,6 @@ alias ssh=color-ssh {{- end }} -{{- if .nrel_hpc }} -# Custom aliases for NREL HPC machines -function load_custom_modules { - - { - module purge - module load gcc - module load mpt - module load binutils - module load bzip2 - module load cmake - module load ffmpeg/4.2.2 - module load git - module load gnutls - module load htop - module load image-magick - module load libffi - module load libtool - module load openssl - module load python/3.7.7 - module load py-setuptools-scm - module load sqlite - module load texlive - module load tmux - - module load emacs/28.2 - module load ccls - } &> /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 -} - -function pyenv_python_install(){ - module load gcc - module load mpt - module load binutils - module load git - module load gnutls - module load libtool - module load texlive - module load bzip2 - module load libffi - module load openssl - module load sqlite - export LDFLAGS="-L${OPENSSL_ROOT_DIR}/lib -L${LIBFFI_ROOT_DIR}/lib64 -L${BZIP2_ROOT_DIR}/lib -L${SQLITE_ROOT_DIR}/lib" - export CPPFLAGS="-I${OPENSSL_ROOT_DIR}/include -I${LIBFFI_ROOT_DIR}/include -I${BZIP2_ROOT_DIR}/include -I${SQLITE_ROOT_DIR}/include" - export PYTHON_CONFIGURE_OPTS="--enable-optimizations --with-lto" - export PYTHON_CFLAGS="-mtune=native" - pyenv install -} -{{ end }} - -{{- if .ornl_hpc }} -# Custom aliases for OLCF HPC machines -function load_custom_modules { - { - module load DefApps-spi/default - module load cmake - module load emacs - module load go - module load htop - module load imagemagick - module load tmux - - module load cray-python - - } &> /dev/null -} -{{ end }} - # Use alternate vim marks [[[ and ]]] as the original ones can # confuse nested substitutions, e.g.: ${${${VAR}}} diff --git a/dot_zshenv.tmpl b/dot_zshenv.tmpl index 3b4790b..a70d810 100644 --- a/dot_zshenv.tmpl +++ b/dot_zshenv.tmpl @@ -80,34 +80,3 @@ export TMPDIR=/tmp alias vlc="{HOME}/Applications/VLC.app/Contents/MacOS/VLC" {{- end }} - - -# paths for NREL HPC -if [ "${NREL_CLUSTER}" = "eagle" ] || [ "${NREL_CLUSTER}" = "ellis" ]; then - - # Set scratch - if [ -d "/scratch/${USER}" ]; then - export SCRATCH="/scratch/${USER}" - fi - - # Set the modules - if [ "${NREL_CLUSTER}" = "eagle" ]; then - source /nopt/nrel/utils/lmod/lmod/init/zsh - source /nopt/nrel/ecom/hpacf/env.sh - module use ${HOME}/modules/linux-centos7-skylake_avx512/gcc-9.3.0 - export TMPDIR=${SCRATCH}/.tmp - elif [ "${NREL_CLUSTER}" = "ellis" ]; then - MODULES_DATE=2023-05-11 - source /data/ssd1/software/${MODULES_DATE}/env.sh - export TMPDIR=/data/ssd1/home/${USER}/.tmp - fi - - # Load some custom modules - . ${HOME}/.oh-my-zsh/custom/functions_nrel_hpc.zsh - load_custom_modules - - # Nek5000 - export PATH="${HOME}/Nek5000/bin:${PATH}" - - -fi diff --git a/dot_zshrc b/dot_zshrc index 39babd2..d4030f4 100644 --- a/dot_zshrc +++ b/dot_zshrc @@ -35,6 +35,9 @@ zinit light-mode for \ ### End of Zinit's installer chunk +# towards the beginning to make sure some software is loaded +zinit lucid light-mode for "hpc" + zinit ice lucid depth"1" zinit light romkatv/powerlevel10k @@ -54,6 +57,7 @@ zinit wait lucid light-mode for \ "OMZP::tmux" \ "OMZP::zoxide" +# towards the end because it assumes some things are set in other plugins zinit wait lucid light-mode for "personal" # Path to your oh-my-zsh installation. @@ -113,9 +117,5 @@ SAVEHIST=$HISTSIZE setopt HIST_IGNORE_ALL_DUPS setopt HIST_FIND_NO_DUPS -if [ "${NREL_CLUSTER}" = "eagle" ] || [ "${NREL_CLUSTER}" = "ellis" ]; then - umask u=rwx,go=rx,o=rx -fi - # To customize prompt, run `p10k configure` or edit ~/.p10k.zsh. [[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh From 832d7c522d9fa68b4cd4fa57ea7399adcb51f175 Mon Sep 17 00:00:00 2001 From: Marc Henry de Frahan Date: Thu, 1 Feb 2024 15:15:42 -0700 Subject: [PATCH 52/78] remove unneeded frontier thing --- dot_zshrc | 7 ------- 1 file changed, 7 deletions(-) diff --git a/dot_zshrc b/dot_zshrc index d4030f4..51f68c7 100644 --- a/dot_zshrc +++ b/dot_zshrc @@ -1,10 +1,3 @@ - -# paths for OLCF HPC, putting this in zshenv doesn't work -if [ "${LMOD_SYSTEM_NAME}" = "frontier" ]; then - . ${HOME}/.oh-my-zsh/custom/functions_olcf_hpc.zsh - load_custom_modules -fi - # Enable Powerlevel10k instant prompt. Should stay close to the top of ~/.zshrc. # Initialization code that may require console input (password prompts, [y/n] # confirmations, etc.) must go above this block; everything else may go below. From 048d4f5a4e68fe6e4234405b2665816e142e241e Mon Sep 17 00:00:00 2001 From: Marc Henry de Frahan Date: Fri, 2 Feb 2024 13:47:39 -0700 Subject: [PATCH 53/78] more robust dl --- dot_zshrc | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/dot_zshrc b/dot_zshrc index 51f68c7..7106283 100644 --- a/dot_zshrc +++ b/dot_zshrc @@ -34,10 +34,9 @@ zinit lucid light-mode for "hpc" zinit ice lucid depth"1" zinit light romkatv/powerlevel10k -# you can wait this if you use zinit with my aliases because they need emacs_plugin_blah variable -# otherwise you can't wait this -zinit lucid light-mode \ - atclone'wget https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/plugins/emacs/emacsclient.sh; chmod +x emacsclient.sh' \ +zinit wait lucid light-mode \ + dl'https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/plugins/emacs/emacsclient.sh' \ + atclone'chmod +x emacsclient.sh' \ atpull'%atclone' \ for "OMZP::emacs" From 1d9c7fe23889b5555e07679ef48f335b776df74f Mon Sep 17 00:00:00 2001 From: Marc Henry de Frahan Date: Tue, 6 Feb 2024 12:30:12 -0700 Subject: [PATCH 54/78] better pyenv install for ellis --- .../zinit/plugins/hpc/hpc.plugin.zsh.tmpl | 47 ++++++++++++------- 1 file changed, 30 insertions(+), 17 deletions(-) diff --git a/dot_local/share/zinit/plugins/hpc/hpc.plugin.zsh.tmpl b/dot_local/share/zinit/plugins/hpc/hpc.plugin.zsh.tmpl index 98290ea..1954374 100644 --- a/dot_local/share/zinit/plugins/hpc/hpc.plugin.zsh.tmpl +++ b/dot_local/share/zinit/plugins/hpc/hpc.plugin.zsh.tmpl @@ -45,7 +45,6 @@ function load_custom_modules { { module purge module load gcc - module load mpt module load binutils module load bzip2 module load cmake @@ -56,12 +55,15 @@ function load_custom_modules { module load image-magick module load libffi module load libtool - module load openssl module load python/3.7.7 module load py-setuptools-scm module load sqlite - module load texlive module load tmux + if [ "${NREL_CLUSTER}" = "eagle" ]; then + module load mpt + module load openssl + module load texlive + fi module load emacs/28.2 module load ccls @@ -82,20 +84,31 @@ function pvtunnel() { ssh -L 11111:$1:11111 mhenryde@$1 } -function pyenv_python_install(){ - module load gcc - module load mpt - module load binutils - module load git - module load gnutls - module load libtool - module load texlive - module load bzip2 - module load libffi - module load openssl - module load sqlite - export LDFLAGS="-L${OPENSSL_ROOT_DIR}/lib -L${LIBFFI_ROOT_DIR}/lib64 -L${BZIP2_ROOT_DIR}/lib -L${SQLITE_ROOT_DIR}/lib" - export CPPFLAGS="-I${OPENSSL_ROOT_DIR}/include -I${LIBFFI_ROOT_DIR}/include -I${BZIP2_ROOT_DIR}/include -I${SQLITE_ROOT_DIR}/include" +function pyenv_python_install() { + if [ "${NREL_CLUSTER}" = "eagle" ]; then + module load gcc + module load binutils + module load git + module load gnutls + module load libtool + module load bzip2 + module load libffi + module load openssl + module load sqlite + export LDFLAGS="-L${OPENSSL_ROOT_DIR}/lib -L${LIBFFI_ROOT_DIR}/lib64 -L${BZIP2_ROOT_DIR}/lib -L${SQLITE_ROOT_DIR}/lib" + export CPPFLAGS="-I${OPENSSL_ROOT_DIR}/include -I${LIBFFI_ROOT_DIR}/include -I${BZIP2_ROOT_DIR}/include -I${SQLITE_ROOT_DIR}/include" + elif [ "${NREL_CLUSTER}" = "ellis" ]; then + module load gcc + module load binutils + module load git + module load gnutls + module load libtool + module load bzip2 + module load libffi + module load sqlite + export LDFLAGS="-L${LIBFFI_ROOT_DIR}/lib64 -L${BZIP2_ROOT_DIR}/lib -L${SQLITE_ROOT_DIR}/lib" + export CPPFLAGS="-I${LIBFFI_ROOT_DIR}/include -I${BZIP2_ROOT_DIR}/include -I${SQLITE_ROOT_DIR}/include" + fi export PYTHON_CONFIGURE_OPTS="--enable-optimizations --with-lto" export PYTHON_CFLAGS="-mtune=native" pyenv install From 89adf7dda5e933f0ccb66a5da036cf16f1e98a71 Mon Sep 17 00:00:00 2001 From: Marc Henry de Frahan Date: Tue, 6 Feb 2024 12:30:49 -0700 Subject: [PATCH 55/78] better colors for ssh --- .../share/zinit/plugins/personal/personal.plugin.zsh.tmpl | 8 ++++---- dot_ssh/config | 4 ---- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/dot_local/share/zinit/plugins/personal/personal.plugin.zsh.tmpl b/dot_local/share/zinit/plugins/personal/personal.plugin.zsh.tmpl index cf91ad3..6ae68b1 100644 --- a/dot_local/share/zinit/plugins/personal/personal.plugin.zsh.tmpl +++ b/dot_local/share/zinit/plugins/personal/personal.plugin.zsh.tmpl @@ -155,13 +155,13 @@ tab-reset() { color-ssh() { if [[ -n "$ITERM_SESSION_ID" ]]; then trap "tab-reset" INT EXIT - if [[ "$*" =~ "navier|other_*_machine" ]]; then + if [[ "$*" =~ "el1|el2|el3|ed1|dav1|dav2|dav3" ]]; then tab-color 24 90 169 - elif [[ "$*" =~ "cori|edison" ]]; then + elif [[ "$*" =~ "kl1|kl2" ]]; then tab-color 244 125 35 - elif [[ "$*" =~ "machine1a|machine1b" ]]; then + elif [[ "$*" =~ "f10|frontier|andes|summit|crusher|ascent|olcf" ]]; then tab-color 102 44 155 - elif [[ "$*" =~ "machine2a|machine2b" ]]; then + elif [[ "$*" =~ "ellis" ]]; then tab-color 162 29 33 elif [[ "$*" =~ "machine3a|machine3b" ]]; then tab-color 180 56 148 diff --git a/dot_ssh/config b/dot_ssh/config index 272982e..8908d2d 100644 --- a/dot_ssh/config +++ b/dot_ssh/config @@ -42,10 +42,6 @@ host dav3 User mhenryde hostname dav3.hpc.nrel.gov -host merlin - User mhenryde - hostname merlin.hpc.nrel.gov - host ellis User mhenryde hostname ellis.hpc.nrel.gov From f26845d911c73e659cf4c04b14082234acf7e108 Mon Sep 17 00:00:00 2001 From: Marc Henry de Frahan Date: Thu, 8 Feb 2024 10:50:48 -0700 Subject: [PATCH 56/78] better ls colors --- dot_zshrc | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/dot_zshrc b/dot_zshrc index 7106283..29fda6a 100644 --- a/dot_zshrc +++ b/dot_zshrc @@ -49,9 +49,17 @@ zinit wait lucid light-mode for \ "OMZP::tmux" \ "OMZP::zoxide" +zinit ice lucid from"gh-r" as"command" \ + mv"vivid-*/vivid -> vivid" \ + atload'export LS_COLORS="$(vivid generate one-dark)"; zstyle ":completion:*" list-colors "${(s.:.)LS_COLORS}"' +zinit light sharkdp/vivid + # towards the end because it assumes some things are set in other plugins zinit wait lucid light-mode for "personal" +# from OMZL: completion, correction, directories, git(?), history, key bindings, termsupport, themeandappearance(? maybe this overrides trapdoor) vcs_info (?) +zstyle ':omz:lib:theme-and-appearance' gnu-ls yes + # Path to your oh-my-zsh installation. export ZSH=$HOME/.oh-my-zsh From 582d10ebdc0de69fd3b9945487335fdb4c7f3c71 Mon Sep 17 00:00:00 2001 From: Marc Henry de Frahan Date: Mon, 12 Feb 2024 09:10:37 -0700 Subject: [PATCH 57/78] make the timer work with ventura --- bin/executable_teatimer.sh | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/bin/executable_teatimer.sh b/bin/executable_teatimer.sh index 6d2f43d..8aeafad 100644 --- a/bin/executable_teatimer.sh +++ b/bin/executable_teatimer.sh @@ -18,15 +18,19 @@ if [ "$(uname)" == "Darwin" ]; then # Make sure sound is enabled osascript -e "set Volume 2" - + + # Doesn't work with ventura # Make sure you installed terminal-notifier with homebrew # Also increase the notification banner time by doing: # defaults write com.apple.notificationcenterui bannerTime 15 # taken from: https://9to5mac.com/2014/01/30/how-to-change-os-x-banner-notification-duration-using-terminal/ - terminal-notifier -title "Your tea is ready!" -message "" -sound default -contentImage "$HOME/bin/tea.jpg"; + # terminal-notifier -title "Your tea is ready!" -message "" -sound default -contentImage "$HOME/bin/tea.jpg"; + + # Display notification + osascript -e 'display notification "--" with title "Your tea is ready"' # Make my own sound aiff with the old system beep? and play it like this - #afplay /System/Library/Sounds/Funk.aiff + afplay /System/Library/Sounds/Funk.aiff # Make sure sound is disabled (but wait for previous command to end) gsleep 1s; From b07dc70f3d39decf4d38be2c79d05a390cc0173d Mon Sep 17 00:00:00 2001 From: Marc Henry de Frahan Date: Mon, 12 Feb 2024 14:33:06 -0700 Subject: [PATCH 58/78] Trying a better history backup --- .../plugins/personal/personal.plugin.zsh.tmpl | 22 +++++++++++++++++++ dot_zshrc | 7 ------ 2 files changed, 22 insertions(+), 7 deletions(-) diff --git a/dot_local/share/zinit/plugins/personal/personal.plugin.zsh.tmpl b/dot_local/share/zinit/plugins/personal/personal.plugin.zsh.tmpl index 6ae68b1..664977b 100644 --- a/dot_local/share/zinit/plugins/personal/personal.plugin.zsh.tmpl +++ b/dot_local/share/zinit/plugins/personal/personal.plugin.zsh.tmpl @@ -136,6 +136,28 @@ multitb() ( return "${exit_code}" ) +# History +HISTFILE=~/.zsh_history +HISTSIZE=1000000 +SAVEHIST=$HISTSIZE +setopt HIST_IGNORE_ALL_DUPS +setopt HIST_FIND_NO_DUPS + +# zsh history backups +export HIST_BACKUP_DIR="${HOME}/.zsh_history_backups" +if [ ! -d "${HIST_BACKUP_DIR}" ]; then + mkdir "${HIST_BACKUP_DIR}" +fi + +function backup_zsh_history () { + if [ -d "${HIST_BACKUP_DIR}" ]; then + local PFX=${${(M)OSTYPE:#*darwin*}:+g} + cp "${HISTFILE}" "${HIST_BACKUP_DIR}/zsh_history_$(${PFX}date +\%Y_\%m_\%d_\%H_\%S_\%N).bak" + fi +} + +backup_zsh_history + {{- if eq .chezmoi.os "darwin" }} # iTerm2 window/tab color commands # Requires iTerm2 >= Build 1.0.0.20110804 diff --git a/dot_zshrc b/dot_zshrc index 29fda6a..a200bab 100644 --- a/dot_zshrc +++ b/dot_zshrc @@ -110,12 +110,5 @@ bindkey "^[[1;5B" down-line-or-history # [CTRL] + Cursor down bindkey "^P" up-line-or-beginning-search # bindkey "^N" down-line-or-beginning-search -# Better history -HISTFILE=~/.zsh_history -HISTSIZE=1000000 -SAVEHIST=$HISTSIZE -setopt HIST_IGNORE_ALL_DUPS -setopt HIST_FIND_NO_DUPS - # To customize prompt, run `p10k configure` or edit ~/.p10k.zsh. [[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh From 7aa36b18d2cd7f8e974758e960db61b3a6561374 Mon Sep 17 00:00:00 2001 From: Marc Henry de Frahan Date: Mon, 12 Feb 2024 14:46:38 -0700 Subject: [PATCH 59/78] don't wait personal --- dot_zshrc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dot_zshrc b/dot_zshrc index a200bab..00f880b 100644 --- a/dot_zshrc +++ b/dot_zshrc @@ -54,8 +54,8 @@ zinit ice lucid from"gh-r" as"command" \ atload'export LS_COLORS="$(vivid generate one-dark)"; zstyle ":completion:*" list-colors "${(s.:.)LS_COLORS}"' zinit light sharkdp/vivid -# towards the end because it assumes some things are set in other plugins -zinit wait lucid light-mode for "personal" +# towards the end because it assumes some things are set in other plugins, dont wait this +zinit lucid light-mode for "personal" # from OMZL: completion, correction, directories, git(?), history, key bindings, termsupport, themeandappearance(? maybe this overrides trapdoor) vcs_info (?) zstyle ':omz:lib:theme-and-appearance' gnu-ls yes From f0f8c804a27afd8f7683fa077825be07236313b2 Mon Sep 17 00:00:00 2001 From: Marc Henry de Frahan Date: Mon, 12 Feb 2024 15:07:09 -0700 Subject: [PATCH 60/78] rejig --- .../plugins/personal/personal.plugin.zsh.tmpl | 22 ---------------- dot_zshrc | 26 +++++++++++++++++-- 2 files changed, 24 insertions(+), 24 deletions(-) diff --git a/dot_local/share/zinit/plugins/personal/personal.plugin.zsh.tmpl b/dot_local/share/zinit/plugins/personal/personal.plugin.zsh.tmpl index 664977b..6ae68b1 100644 --- a/dot_local/share/zinit/plugins/personal/personal.plugin.zsh.tmpl +++ b/dot_local/share/zinit/plugins/personal/personal.plugin.zsh.tmpl @@ -136,28 +136,6 @@ multitb() ( return "${exit_code}" ) -# History -HISTFILE=~/.zsh_history -HISTSIZE=1000000 -SAVEHIST=$HISTSIZE -setopt HIST_IGNORE_ALL_DUPS -setopt HIST_FIND_NO_DUPS - -# zsh history backups -export HIST_BACKUP_DIR="${HOME}/.zsh_history_backups" -if [ ! -d "${HIST_BACKUP_DIR}" ]; then - mkdir "${HIST_BACKUP_DIR}" -fi - -function backup_zsh_history () { - if [ -d "${HIST_BACKUP_DIR}" ]; then - local PFX=${${(M)OSTYPE:#*darwin*}:+g} - cp "${HISTFILE}" "${HIST_BACKUP_DIR}/zsh_history_$(${PFX}date +\%Y_\%m_\%d_\%H_\%S_\%N).bak" - fi -} - -backup_zsh_history - {{- if eq .chezmoi.os "darwin" }} # iTerm2 window/tab color commands # Requires iTerm2 >= Build 1.0.0.20110804 diff --git a/dot_zshrc b/dot_zshrc index 00f880b..9d4d4ce 100644 --- a/dot_zshrc +++ b/dot_zshrc @@ -54,8 +54,8 @@ zinit ice lucid from"gh-r" as"command" \ atload'export LS_COLORS="$(vivid generate one-dark)"; zstyle ":completion:*" list-colors "${(s.:.)LS_COLORS}"' zinit light sharkdp/vivid -# towards the end because it assumes some things are set in other plugins, dont wait this -zinit lucid light-mode for "personal" +# towards the end because it assumes some things are set in other plugins +zinit wait lucid light-mode for "personal" # from OMZL: completion, correction, directories, git(?), history, key bindings, termsupport, themeandappearance(? maybe this overrides trapdoor) vcs_info (?) zstyle ':omz:lib:theme-and-appearance' gnu-ls yes @@ -110,5 +110,27 @@ bindkey "^[[1;5B" down-line-or-history # [CTRL] + Cursor down bindkey "^P" up-line-or-beginning-search # bindkey "^N" down-line-or-beginning-search +# History +HISTFILE=~/.zsh_history +HISTSIZE=1000000 +SAVEHIST=$HISTSIZE +setopt HIST_IGNORE_ALL_DUPS +setopt HIST_FIND_NO_DUPS + +# zsh history backups +export HIST_BACKUP_DIR="${HOME}/.zsh_history_backups" +if [ ! -d "${HIST_BACKUP_DIR}" ]; then + mkdir "${HIST_BACKUP_DIR}" +fi + +function backup_zsh_history () { + if [ -d "${HIST_BACKUP_DIR}" ]; then + local PFX=${${(M)OSTYPE:#*darwin*}:+g} + cp "${HISTFILE}" "${HIST_BACKUP_DIR}/zsh_history_$(${PFX}date +\%Y_\%m_\%d_\%H_\%S_\%N).bak" + fi +} + +backup_zsh_history + # To customize prompt, run `p10k configure` or edit ~/.p10k.zsh. [[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh From 777dd219cdf32bdeba022674ba0dc16c8d47a576 Mon Sep 17 00:00:00 2001 From: Marc Henry de Frahan Date: Mon, 12 Feb 2024 17:17:04 -0500 Subject: [PATCH 61/78] enable fzf finding --- dot_zshrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dot_zshrc b/dot_zshrc index 9d4d4ce..26442e9 100644 --- a/dot_zshrc +++ b/dot_zshrc @@ -41,7 +41,7 @@ zinit wait lucid light-mode \ for "OMZP::emacs" zinit wait lucid light-mode for \ - has'fzf' "OMZP::fzf" \ + "OMZP::fzf" \ has'fzf' @Aloxaf/fzf-tab \ "OMZP::git" \ "OMZP::poetry" \ From cb2a27828387cf53a94de8c0a827dc536b8d51f0 Mon Sep 17 00:00:00 2001 From: Marc Henry de Frahan Date: Tue, 13 Feb 2024 08:27:05 -0700 Subject: [PATCH 62/78] less frequent backup --- dot_zshrc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/dot_zshrc b/dot_zshrc index 26442e9..74d2bec 100644 --- a/dot_zshrc +++ b/dot_zshrc @@ -126,7 +126,10 @@ fi function backup_zsh_history () { if [ -d "${HIST_BACKUP_DIR}" ]; then local PFX=${${(M)OSTYPE:#*darwin*}:+g} - cp "${HISTFILE}" "${HIST_BACKUP_DIR}/zsh_history_$(${PFX}date +\%Y_\%m_\%d_\%H_\%S_\%N).bak" + HISTFILE_BAK="${HIST_BACKUP_DIR}/zsh_history_$(${PFX}date +\%Y_\%m_\%d).bak" + if [ ! -f "${HISTFILE_BAK}" ]; then + cp "${HISTFILE}" "${HISTFILE_BAK}" + fi fi } From 5d00c13e07621fe82f31e2ccc258fec0757fdb31 Mon Sep 17 00:00:00 2001 From: Marc Henry de Frahan Date: Tue, 13 Feb 2024 08:27:39 -0700 Subject: [PATCH 63/78] cleaner --- dot_zshrc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/dot_zshrc b/dot_zshrc index 74d2bec..c5a72d0 100644 --- a/dot_zshrc +++ b/dot_zshrc @@ -125,8 +125,7 @@ fi function backup_zsh_history () { if [ -d "${HIST_BACKUP_DIR}" ]; then - local PFX=${${(M)OSTYPE:#*darwin*}:+g} - HISTFILE_BAK="${HIST_BACKUP_DIR}/zsh_history_$(${PFX}date +\%Y_\%m_\%d).bak" + HISTFILE_BAK="${HIST_BACKUP_DIR}/zsh_history_$(date +\%Y_\%m_\%d).bak" if [ ! -f "${HISTFILE_BAK}" ]; then cp "${HISTFILE}" "${HISTFILE_BAK}" fi From 89e1356c54c01109c11e61c04c977e99411921b1 Mon Sep 17 00:00:00 2001 From: Marc Henry de Frahan Date: Thu, 15 Feb 2024 14:28:16 -0700 Subject: [PATCH 64/78] Better nrel cluster management --- .chezmoi.toml.tmpl | 4 +- .../zinit/plugins/hpc/hpc.plugin.zsh.tmpl | 78 +++++++++---------- 2 files changed, 42 insertions(+), 40 deletions(-) diff --git a/.chezmoi.toml.tmpl b/.chezmoi.toml.tmpl index 82ea418..f5e0895 100644 --- a/.chezmoi.toml.tmpl +++ b/.chezmoi.toml.tmpl @@ -7,7 +7,8 @@ {{ $test_machine := promptBoolOnce . "test_machine" "test_machine" }} {{ $nrel_hpc := false -}} -{{- if or (eq (env "NREL_CLUSTER") "eagle") (eq (env "NREL_CLUSTER") "ellis") -}} +{{ $nrel_cluster := env "NREL_CLUSTER" | quote -}} +{{- if or (eq (env "NREL_CLUSTER") "eagle") (eq (env "NREL_CLUSTER") "ellis") (eq (env "NREL_CLUSTER") "kestrel") -}} {{ $nrel_hpc = true -}} {{- end -}} @@ -22,4 +23,5 @@ test_machine = {{ $test_machine }} spack_packages = false nrel_hpc = {{ $nrel_hpc }} + nrel_cluster = {{ $nrel_cluster }} ornl_hpc = {{ $ornl_hpc }} \ No newline at end of file diff --git a/dot_local/share/zinit/plugins/hpc/hpc.plugin.zsh.tmpl b/dot_local/share/zinit/plugins/hpc/hpc.plugin.zsh.tmpl index 1954374..8e469fb 100644 --- a/dot_local/share/zinit/plugins/hpc/hpc.plugin.zsh.tmpl +++ b/dot_local/share/zinit/plugins/hpc/hpc.plugin.zsh.tmpl @@ -27,16 +27,16 @@ if [ -d "/scratch/${USER}" ]; then fi # Set the modules -if [ "${NREL_CLUSTER}" = "eagle" ]; then - source /nopt/nrel/utils/lmod/lmod/init/zsh - source /nopt/nrel/ecom/hpacf/env.sh - module use ${HOME}/modules/linux-centos7-skylake_avx512/gcc-9.3.0 - export TMPDIR=${SCRATCH}/.tmp -elif [ "${NREL_CLUSTER}" = "ellis" ]; then - MODULES_DATE=2023-05-11 - source /data/ssd1/software/${MODULES_DATE}/env.sh - export TMPDIR=/data/ssd1/home/${USER}/.tmp -fi +{{- if eq .nrel_cluster "eagle" }} +source /nopt/nrel/utils/lmod/lmod/init/zsh +source /nopt/nrel/ecom/hpacf/env.sh +module use ${HOME}/modules/linux-centos7-skylake_avx512/gcc-9.3.0 +export TMPDIR=${SCRATCH}/.tmp +{{- else if eq .nrel_cluster "ellis" }} +MODULES_DATE=2023-05-11 +source /data/ssd1/software/${MODULES_DATE}/env.sh +export TMPDIR=/data/ssd1/home/${USER}/.tmp +{{- end }} umask u=rwx,go=rx,o=rx @@ -59,11 +59,11 @@ function load_custom_modules { module load py-setuptools-scm module load sqlite module load tmux - if [ "${NREL_CLUSTER}" = "eagle" ]; then - module load mpt - module load openssl - module load texlive - fi + {{- if eq .nrel_cluster "eagle" }} + module load mpt + module load openssl + module load texlive + {{- end }} module load emacs/28.2 module load ccls @@ -85,30 +85,30 @@ function pvtunnel() { } function pyenv_python_install() { - if [ "${NREL_CLUSTER}" = "eagle" ]; then - module load gcc - module load binutils - module load git - module load gnutls - module load libtool - module load bzip2 - module load libffi - module load openssl - module load sqlite - export LDFLAGS="-L${OPENSSL_ROOT_DIR}/lib -L${LIBFFI_ROOT_DIR}/lib64 -L${BZIP2_ROOT_DIR}/lib -L${SQLITE_ROOT_DIR}/lib" - export CPPFLAGS="-I${OPENSSL_ROOT_DIR}/include -I${LIBFFI_ROOT_DIR}/include -I${BZIP2_ROOT_DIR}/include -I${SQLITE_ROOT_DIR}/include" - elif [ "${NREL_CLUSTER}" = "ellis" ]; then - module load gcc - module load binutils - module load git - module load gnutls - module load libtool - module load bzip2 - module load libffi - module load sqlite - export LDFLAGS="-L${LIBFFI_ROOT_DIR}/lib64 -L${BZIP2_ROOT_DIR}/lib -L${SQLITE_ROOT_DIR}/lib" - export CPPFLAGS="-I${LIBFFI_ROOT_DIR}/include -I${BZIP2_ROOT_DIR}/include -I${SQLITE_ROOT_DIR}/include" - fi + {{- if eq .nrel_cluster "eagle" }} + module load gcc + module load binutils + module load git + module load gnutls + module load libtool + module load bzip2 + module load libffi + module load openssl + module load sqlite + export LDFLAGS="-L${OPENSSL_ROOT_DIR}/lib -L${LIBFFI_ROOT_DIR}/lib64 -L${BZIP2_ROOT_DIR}/lib -L${SQLITE_ROOT_DIR}/lib" + export CPPFLAGS="-I${OPENSSL_ROOT_DIR}/include -I${LIBFFI_ROOT_DIR}/include -I${BZIP2_ROOT_DIR}/include -I${SQLITE_ROOT_DIR}/include" + {{- else if eq .nrel_cluster "ellis" }} + module load gcc + module load binutils + module load git + module load gnutls + module load libtool + module load bzip2 + module load libffi + module load sqlite + export LDFLAGS="-L${LIBFFI_ROOT_DIR}/lib64 -L${BZIP2_ROOT_DIR}/lib -L${SQLITE_ROOT_DIR}/lib" + export CPPFLAGS="-I${LIBFFI_ROOT_DIR}/include -I${BZIP2_ROOT_DIR}/include -I${SQLITE_ROOT_DIR}/include" + {{- end }} export PYTHON_CONFIGURE_OPTS="--enable-optimizations --with-lto" export PYTHON_CFLAGS="-mtune=native" pyenv install From a0d9ba38575728763a10a904a1495b88d5271a3a Mon Sep 17 00:00:00 2001 From: Marc Henry de Frahan Date: Thu, 15 Feb 2024 15:01:36 -0700 Subject: [PATCH 65/78] fix kestrel --- dot_local/share/zinit/plugins/hpc/hpc.plugin.zsh.tmpl | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/dot_local/share/zinit/plugins/hpc/hpc.plugin.zsh.tmpl b/dot_local/share/zinit/plugins/hpc/hpc.plugin.zsh.tmpl index 8e469fb..7750f81 100644 --- a/dot_local/share/zinit/plugins/hpc/hpc.plugin.zsh.tmpl +++ b/dot_local/share/zinit/plugins/hpc/hpc.plugin.zsh.tmpl @@ -36,6 +36,10 @@ export TMPDIR=${SCRATCH}/.tmp MODULES_DATE=2023-05-11 source /data/ssd1/software/${MODULES_DATE}/env.sh export TMPDIR=/data/ssd1/home/${USER}/.tmp +{{- else if eq .nrel_cluster "kestrel" }} +source /opt/cray/pe/lmod/lmod/init/zsh +source /nopt/nrel/apps/env.sh +export TMPDIR=${SCRATCH}/.tmp {{- end }} umask u=rwx,go=rx,o=rx From 1d41bbfbb44cf86d6bf72e76123c0a54d1211cdf Mon Sep 17 00:00:00 2001 From: Marc Henry de Frahan Date: Thu, 15 Feb 2024 15:04:34 -0700 Subject: [PATCH 66/78] debug kestrel --- .../zinit/plugins/hpc/hpc.plugin.zsh.tmpl | 48 +++++++++---------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/dot_local/share/zinit/plugins/hpc/hpc.plugin.zsh.tmpl b/dot_local/share/zinit/plugins/hpc/hpc.plugin.zsh.tmpl index 7750f81..163260a 100644 --- a/dot_local/share/zinit/plugins/hpc/hpc.plugin.zsh.tmpl +++ b/dot_local/share/zinit/plugins/hpc/hpc.plugin.zsh.tmpl @@ -47,30 +47,30 @@ umask u=rwx,go=rx,o=rx function load_custom_modules { { - module purge - module load gcc - module load binutils - module load bzip2 - module load cmake - module load ffmpeg/4.2.2 - module load git - module load gnutls - module load htop - module load image-magick - module load libffi - module load libtool - module load python/3.7.7 - module load py-setuptools-scm - module load sqlite - module load tmux - {{- if eq .nrel_cluster "eagle" }} - module load mpt - module load openssl - module load texlive - {{- end }} - - module load emacs/28.2 - module load ccls + # module purge + # module load gcc + # module load binutils + # module load bzip2 + # module load cmake + # module load ffmpeg/4.2.2 + # module load git + # module load gnutls + # module load htop + # module load image-magick + # module load libffi + # module load libtool + # module load python/3.7.7 + # module load py-setuptools-scm + # module load sqlite + # module load tmux + # {{- if eq .nrel_cluster "eagle" }} + # module load mpt + # module load openssl + # module load texlive + # {{- end }} + + # module load emacs/28.2 + # module load ccls } &> /dev/null } From 29fc43ba30dd92da141db52a7a896ead283cd44b Mon Sep 17 00:00:00 2001 From: Marc Henry de Frahan Date: Thu, 15 Feb 2024 15:15:39 -0700 Subject: [PATCH 67/78] revert thing --- .../zinit/plugins/hpc/hpc.plugin.zsh.tmpl | 48 +++++++++---------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/dot_local/share/zinit/plugins/hpc/hpc.plugin.zsh.tmpl b/dot_local/share/zinit/plugins/hpc/hpc.plugin.zsh.tmpl index 163260a..7750f81 100644 --- a/dot_local/share/zinit/plugins/hpc/hpc.plugin.zsh.tmpl +++ b/dot_local/share/zinit/plugins/hpc/hpc.plugin.zsh.tmpl @@ -47,30 +47,30 @@ umask u=rwx,go=rx,o=rx function load_custom_modules { { - # module purge - # module load gcc - # module load binutils - # module load bzip2 - # module load cmake - # module load ffmpeg/4.2.2 - # module load git - # module load gnutls - # module load htop - # module load image-magick - # module load libffi - # module load libtool - # module load python/3.7.7 - # module load py-setuptools-scm - # module load sqlite - # module load tmux - # {{- if eq .nrel_cluster "eagle" }} - # module load mpt - # module load openssl - # module load texlive - # {{- end }} - - # module load emacs/28.2 - # module load ccls + module purge + module load gcc + module load binutils + module load bzip2 + module load cmake + module load ffmpeg/4.2.2 + module load git + module load gnutls + module load htop + module load image-magick + module load libffi + module load libtool + module load python/3.7.7 + module load py-setuptools-scm + module load sqlite + module load tmux + {{- if eq .nrel_cluster "eagle" }} + module load mpt + module load openssl + module load texlive + {{- end }} + + module load emacs/28.2 + module load ccls } &> /dev/null } From 94904adba5aa5e6796dec99a097458c85e004b33 Mon Sep 17 00:00:00 2001 From: Marc Henry de Frahan Date: Fri, 16 Feb 2024 09:34:29 -0700 Subject: [PATCH 68/78] add a python version for things --- .python-version | 1 + 1 file changed, 1 insertion(+) create mode 100644 .python-version diff --git a/.python-version b/.python-version new file mode 100644 index 0000000..7a82656 --- /dev/null +++ b/.python-version @@ -0,0 +1 @@ +3.11.1 \ No newline at end of file From 8684910111aebb2b6968a649696da43c61149733 Mon Sep 17 00:00:00 2001 From: Marc Henry de Frahan Date: Fri, 16 Feb 2024 09:57:04 -0700 Subject: [PATCH 69/78] remove python version --- .python-version | 1 - 1 file changed, 1 deletion(-) delete mode 100644 .python-version diff --git a/.python-version b/.python-version deleted file mode 100644 index 7a82656..0000000 --- a/.python-version +++ /dev/null @@ -1 +0,0 @@ -3.11.1 \ No newline at end of file From f4bcc03469ca2f2f677dc31f562f5e98d7f9e5d8 Mon Sep 17 00:00:00 2001 From: Marc Henry de Frahan Date: Fri, 16 Feb 2024 10:50:21 -0700 Subject: [PATCH 70/78] playing with spack --- ...ter_install-spack-packages-cluster.sh.tmpl | 85 ++++++++++--------- 1 file changed, 46 insertions(+), 39 deletions(-) diff --git a/run_once_after_install-spack-packages-cluster.sh.tmpl b/run_once_after_install-spack-packages-cluster.sh.tmpl index fd77c26..b1f1a73 100644 --- a/run_once_after_install-spack-packages-cluster.sh.tmpl +++ b/run_once_after_install-spack-packages-cluster.sh.tmpl @@ -7,52 +7,59 @@ cmd() { eval "$@" } -echo "Setting up packages with spack-manager" +echo "Setting up packages with spack" cmd "cd ${HOME}" -if [ ! -d "${HOME}/spack-manager" ]; then - cmd "git clone --recursive git@github.com:sandialabs/spack-manager.git" +if [ ! -d "${HOME}/spack" ]; then + cmd "git clone -c feature.manyFiles=true https://github.com/spack/spack.git" fi -cmd "export SPACK_MANAGER=${HOME}/spack-manager" -cmd "source ${SPACK_MANAGER}/start.sh" +cmd "export SPACK_DIR=${HOME}/spack" +cmd "source ${SPACK_DIR}/share/spack/setup-env.sh" ENV_NAME="prog-utils" -ENV_DIR="${SPACK_MANAGER}/environments/${ENV_NAME}" -MODULE_DIR="${HOME}/modules" - -cmd "mkdir -p ${MODULE_DIR}" -cmd "quick-create -n ${ENV_NAME}" -cmd "quick-activate ${ENV_DIR}" - -# cmd "spack add emacs@29.0+tls+native+treesitter+json" -cmd "spack add emacs@28.2+tls+json%gcc" -cmd "spack add ccls%gcc" - -if [ ! -z $(grep -L "modules:" "${ENV_DIR}/spack.yaml") ]; then - echo "Adding modules to spack.yaml" - echo " modules: - default: - roots: - tcl: ${MODULE_DIR} - tcl: - projections: - all: '{compiler.name}-{compiler.version}/{name}/{version}/{hash:4}' - hash_length: 0 - all: - conflict: - - '{name}' - environment: - set: - '{name}_ROOT_DIR': '{prefix}' - include: [emacs, ccls] - exclude: ['%gcc']" >> "${ENV_DIR}/spack.yaml" -fi +ENV_DIR="${SPACK_DIR}/var/spack/environments/${ENV_NAME}" +cmd "spack env activate --create ${ENV_NAME}" + + +cmd "spack add emacs@29.2+tls+native+treesitter+json%gcc" +# cmd "spack add emacs@28.2+tls+json%gcc" +# cmd "spack add ccls%gcc" cmd "spack concretize -f" -cmd "spack install" -cmd "spack module tcl refresh -y" +cmd "spack env deactivate" + +# MODULE_DIR="${HOME}/modules" + +# cmd "mkdir -p ${MODULE_DIR}" +# cmd "quick-create -n ${ENV_NAME}" +# cmd "quick-activate ${ENV_DIR}" + + +# if [ ! -z $(grep -L "modules:" "${ENV_DIR}/spack.yaml") ]; then +# echo "Adding modules to spack.yaml" +# echo " modules: +# default: +# roots: +# tcl: ${MODULE_DIR} +# tcl: +# projections: +# all: '{compiler.name}-{compiler.version}/{name}/{version}/{hash:4}' +# hash_length: 0 +# all: +# conflict: +# - '{name}' +# environment: +# set: +# '{name}_ROOT_DIR': '{prefix}' +# include: [emacs, ccls] +# exclude: ['%gcc']" >> "${ENV_DIR}/spack.yaml" +# fi + +# cmd "spack concretize -f" +# cmd "spack install" +# cmd "spack module tcl refresh -y" -cmd "touch ${MODULE_DIR}/linux-centos7-skylake_avx512/gcc-9.3.0/ccls/.version" -cmd "rm -rf ~/.lmod.d/.cache" +# cmd "touch ${MODULE_DIR}/linux-centos7-skylake_avx512/gcc-9.3.0/ccls/.version" +# cmd "rm -rf ~/.lmod.d/.cache" {{ end -}} \ No newline at end of file From 4a2cfef3ad82c80b4c341a786b2bd8cde1c43167 Mon Sep 17 00:00:00 2001 From: Marc Henry de Frahan Date: Tue, 20 Feb 2024 10:13:21 -0700 Subject: [PATCH 71/78] Trying a better python setup --- bin/executable_pyenv_python_install.tmpl | 42 ++++++++++++ .../zinit/plugins/hpc/hpc.plugin.zsh.tmpl | 29 --------- run_once_after_install-python-setup.sh | 64 +++++++++++++++++++ 3 files changed, 106 insertions(+), 29 deletions(-) create mode 100644 bin/executable_pyenv_python_install.tmpl create mode 100644 run_once_after_install-python-setup.sh diff --git a/bin/executable_pyenv_python_install.tmpl b/bin/executable_pyenv_python_install.tmpl new file mode 100644 index 0000000..1103194 --- /dev/null +++ b/bin/executable_pyenv_python_install.tmpl @@ -0,0 +1,42 @@ +#!/usr/bin/env bash + +if [[ ! -x "$(command -v pyenv)" ]]; then + echo "Please install pyenv" + exit 1 +fi + +{{- if eq .nrel_cluster "eagle" }} +module load gcc +module load binutils +module load git +module load gnutls +module load libtool +module load bzip2 +module load libffi +module load openssl +module load sqlite +export LDFLAGS="-L${OPENSSL_ROOT_DIR}/lib -L${LIBFFI_ROOT_DIR}/lib64 -L${BZIP2_ROOT_DIR}/lib -L${SQLITE_ROOT_DIR}/lib" +export CPPFLAGS="-I${OPENSSL_ROOT_DIR}/include -I${LIBFFI_ROOT_DIR}/include -I${BZIP2_ROOT_DIR}/include -I${SQLITE_ROOT_DIR}/include" +{{- else if eq .nrel_cluster "ellis" }} +module load gcc +module load binutils +module load git +module load gnutls +module load libtool +module load bzip2 +module load libffi +module load sqlite +export LDFLAGS="-L${LIBFFI_ROOT_DIR}/lib64 -L${BZIP2_ROOT_DIR}/lib -L${SQLITE_ROOT_DIR}/lib" +export CPPFLAGS="-I${LIBFFI_ROOT_DIR}/include -I${BZIP2_ROOT_DIR}/include -I${SQLITE_ROOT_DIR}/include" +{{- end }} +export PYTHON_CONFIGURE_OPTS="--enable-optimizations --with-lto" +export PYTHON_CFLAGS="-mtune=native" + + +PYTHON_VERSION="${1}" +if [ ! -z "$python_version" ] +then + pyenv install +else + pyenv install -s ${PYTHON_VERSION} +fi diff --git a/dot_local/share/zinit/plugins/hpc/hpc.plugin.zsh.tmpl b/dot_local/share/zinit/plugins/hpc/hpc.plugin.zsh.tmpl index 7750f81..d0306ac 100644 --- a/dot_local/share/zinit/plugins/hpc/hpc.plugin.zsh.tmpl +++ b/dot_local/share/zinit/plugins/hpc/hpc.plugin.zsh.tmpl @@ -88,35 +88,6 @@ function pvtunnel() { ssh -L 11111:$1:11111 mhenryde@$1 } -function pyenv_python_install() { - {{- if eq .nrel_cluster "eagle" }} - module load gcc - module load binutils - module load git - module load gnutls - module load libtool - module load bzip2 - module load libffi - module load openssl - module load sqlite - export LDFLAGS="-L${OPENSSL_ROOT_DIR}/lib -L${LIBFFI_ROOT_DIR}/lib64 -L${BZIP2_ROOT_DIR}/lib -L${SQLITE_ROOT_DIR}/lib" - export CPPFLAGS="-I${OPENSSL_ROOT_DIR}/include -I${LIBFFI_ROOT_DIR}/include -I${BZIP2_ROOT_DIR}/include -I${SQLITE_ROOT_DIR}/include" - {{- else if eq .nrel_cluster "ellis" }} - module load gcc - module load binutils - module load git - module load gnutls - module load libtool - module load bzip2 - module load libffi - module load sqlite - export LDFLAGS="-L${LIBFFI_ROOT_DIR}/lib64 -L${BZIP2_ROOT_DIR}/lib -L${SQLITE_ROOT_DIR}/lib" - export CPPFLAGS="-I${LIBFFI_ROOT_DIR}/include -I${BZIP2_ROOT_DIR}/include -I${SQLITE_ROOT_DIR}/include" - {{- end }} - export PYTHON_CONFIGURE_OPTS="--enable-optimizations --with-lto" - export PYTHON_CFLAGS="-mtune=native" - pyenv install -} {{ end }} {{- if .ornl_hpc }} diff --git a/run_once_after_install-python-setup.sh b/run_once_after_install-python-setup.sh new file mode 100644 index 0000000..946affe --- /dev/null +++ b/run_once_after_install-python-setup.sh @@ -0,0 +1,64 @@ +#!/usr/bin/env bash + +# start clean +# rm -rf $(pyenv root) +# curl -sSL https://install.python-poetry.org | POETRY_VERSION=1.7.0 POETRY_HOME=${HOME}/.poetry python3 - --uninstall + + +# Make sure python3 installation worked +if ! command -v python3 >/dev/null 2>&1; then + echo "Please install python3" + exit 1 +fi + +# Install pyenv and a sane python +if [[ ! -x "$(command -v pyenv)" ]]; then + curl https://pyenv.run | bash +fi + +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 + +PYTHON_VERSION="3.11.1" +${HOME}/bin/pyenv_python_install ${PYTHON_VERSION} + +# Install poetry with the pyenv python +if [[ ! -x "$(command -v poetry)" ]]; then + curl -sSL https://install.python-poetry.org | PYENV_VERSION=${PYTHON_VERSION} POETRY_VERSION=1.7.0 POETRY_HOME=${HOME}/.poetry python3 - +fi + +# Create a sane dotfiles venv +export PYENV_VERSION=${PYTHON_VERSION} +export WORKON_HOME=${HOME}/.virtualenvs +venv_name="dotfiles" +venv_location="${WORKON_HOME}/${venv_name}" + +echo "Installing dotfiles venv at ${venv_location} with $(python --version)" + +python -m venv "${venv_location}" +source ${venv_location}/bin/activate +python -m pip install --upgrade pip +pip install --requirement=/dev/stdin < Date: Tue, 20 Feb 2024 12:32:17 -0500 Subject: [PATCH 72/78] remove old python thing --- run_once_before_install-python-venv.sh | 36 -------------------------- 1 file changed, 36 deletions(-) delete mode 100644 run_once_before_install-python-venv.sh diff --git a/run_once_before_install-python-venv.sh b/run_once_before_install-python-venv.sh deleted file mode 100644 index e36a2c3..0000000 --- a/run_once_before_install-python-venv.sh +++ /dev/null @@ -1,36 +0,0 @@ -#!/usr/bin/env bash - -# Make sure python3 is installed -if ! command -v python3 >/dev/null 2>&1; then - echo "Please install python3" - exit 1 -fi - -export WORKON_HOME=${HOME}/.virtualenvs -venv_name="dotfiles" -venv_location="${WORKON_HOME}/${venv_name}" - -python3 -m venv "${venv_location}" -source ${venv_location}/bin/activate -python3 -m pip install --upgrade pip -pip3 install --requirement=/dev/stdin < Date: Tue, 20 Feb 2024 10:56:34 -0700 Subject: [PATCH 73/78] fix ellis python --- bin/executable_pyenv_python_install.tmpl | 2 ++ 1 file changed, 2 insertions(+) diff --git a/bin/executable_pyenv_python_install.tmpl b/bin/executable_pyenv_python_install.tmpl index 1103194..7beb094 100644 --- a/bin/executable_pyenv_python_install.tmpl +++ b/bin/executable_pyenv_python_install.tmpl @@ -18,6 +18,8 @@ module load sqlite export LDFLAGS="-L${OPENSSL_ROOT_DIR}/lib -L${LIBFFI_ROOT_DIR}/lib64 -L${BZIP2_ROOT_DIR}/lib -L${SQLITE_ROOT_DIR}/lib" export CPPFLAGS="-I${OPENSSL_ROOT_DIR}/include -I${LIBFFI_ROOT_DIR}/include -I${BZIP2_ROOT_DIR}/include -I${SQLITE_ROOT_DIR}/include" {{- else if eq .nrel_cluster "ellis" }} +MODULES_DATE=2023-05-11 +source /data/ssd1/software/${MODULES_DATE}/env.sh module load gcc module load binutils module load git From 453cd926cc40b36580cc8569e68b61de3d96dd9e Mon Sep 17 00:00:00 2001 From: Marc Henry de Frahan Date: Tue, 20 Feb 2024 11:34:53 -0700 Subject: [PATCH 74/78] fix eagle python --- bin/executable_pyenv_python_install.tmpl | 2 ++ 1 file changed, 2 insertions(+) diff --git a/bin/executable_pyenv_python_install.tmpl b/bin/executable_pyenv_python_install.tmpl index 7beb094..0e02e11 100644 --- a/bin/executable_pyenv_python_install.tmpl +++ b/bin/executable_pyenv_python_install.tmpl @@ -6,6 +6,8 @@ if [[ ! -x "$(command -v pyenv)" ]]; then fi {{- if eq .nrel_cluster "eagle" }} +source /nopt/nrel/ecom/hpacf/env.sh +module use ${HOME}/modules/linux-centos7-skylake_avx512 module load gcc module load binutils module load git From ee1c1189f93efc8aadee880acbb94f55ab121fd1 Mon Sep 17 00:00:00 2001 From: Marc Henry de Frahan Date: Mon, 26 Feb 2024 10:50:59 -0700 Subject: [PATCH 75/78] minor update --- dot_zshrc | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/dot_zshrc b/dot_zshrc index c5a72d0..9ef97e3 100644 --- a/dot_zshrc +++ b/dot_zshrc @@ -57,13 +57,11 @@ zinit light sharkdp/vivid # towards the end because it assumes some things are set in other plugins zinit wait lucid light-mode for "personal" -# from OMZL: completion, correction, directories, git(?), history, key bindings, termsupport, themeandappearance(? maybe this overrides trapdoor) vcs_info (?) -zstyle ':omz:lib:theme-and-appearance' gnu-ls yes - # Path to your oh-my-zsh installation. export ZSH=$HOME/.oh-my-zsh -# Uncomment the following line to enable command auto-correction. +# OMZL options +zstyle ':omz:lib:theme-and-appearance' gnu-ls yes ENABLE_CORRECTION="true" CORRECT_IGNORE_FILE='.*' From 4a0cda2e07bbdea7cac23711332aea609b6098fa Mon Sep 17 00:00:00 2001 From: Marc Henry de Frahan Date: Mon, 26 Feb 2024 10:59:58 -0700 Subject: [PATCH 76/78] better omz install --- run_once_before_install-packages-cli.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/run_once_before_install-packages-cli.sh b/run_once_before_install-packages-cli.sh index 8226e0e..e73ecb8 100644 --- a/run_once_before_install-packages-cli.sh +++ b/run_once_before_install-packages-cli.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash if [ ! -d "${HOME}/.oh-my-zsh" ]; then - sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" + sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" "" --unattended --keep-zshrc fi if [[ ! -x "$(command -v poetry)" ]]; then From 5540a89967415884612628a5a8ace13a15eeec27 Mon Sep 17 00:00:00 2001 From: Marc Henry de Frahan Date: Mon, 26 Feb 2024 12:05:20 -0700 Subject: [PATCH 77/78] fix ellis python module --- dot_local/share/zinit/plugins/hpc/hpc.plugin.zsh.tmpl | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/dot_local/share/zinit/plugins/hpc/hpc.plugin.zsh.tmpl b/dot_local/share/zinit/plugins/hpc/hpc.plugin.zsh.tmpl index d0306ac..851f591 100644 --- a/dot_local/share/zinit/plugins/hpc/hpc.plugin.zsh.tmpl +++ b/dot_local/share/zinit/plugins/hpc/hpc.plugin.zsh.tmpl @@ -59,14 +59,16 @@ function load_custom_modules { module load image-magick module load libffi module load libtool - module load python/3.7.7 module load py-setuptools-scm module load sqlite module load tmux {{- if eq .nrel_cluster "eagle" }} + module load python/3.7.7 module load mpt module load openssl module load texlive + {{- else if eq .nrel_cluster "ellis" }} + module load python/3.10.10 {{- end }} module load emacs/28.2 From a767450122259af4b20ad6eeaacad959f2ddcdc9 Mon Sep 17 00:00:00 2001 From: Marc Henry de Frahan Date: Thu, 29 Feb 2024 13:36:03 -0700 Subject: [PATCH 78/78] switch to exawind manager --- dot_emacs | 25 +++++++++++++------------ dot_zshenv.tmpl | 8 ++++---- 2 files changed, 17 insertions(+), 16 deletions(-) diff --git a/dot_emacs b/dot_emacs index 91ac856..1163578 100644 --- a/dot_emacs +++ b/dot_emacs @@ -151,18 +151,19 @@ (add-to-list 'lsp-file-watch-ignored-directories "[/\\\\]tmp_build_dir\\'") (add-to-list 'lsp-file-watch-ignored-directories "[/\\\\]spack-build-.+\\'") (add-to-list 'lsp-file-watch-ignored-directories "[/\\\\].spack-env\\'") - (add-to-list 'lsp-file-watch-ignored-directories "[/\\\\]spack-manager/.cache\\'") - (add-to-list 'lsp-file-watch-ignored-directories "[/\\\\]spack-manager/.tmp\\'") - (add-to-list 'lsp-file-watch-ignored-directories "[/\\\\]spack-manager/configs\\'") - (add-to-list 'lsp-file-watch-ignored-directories "[/\\\\]spack-manager/docs\\'") - (add-to-list 'lsp-file-watch-ignored-directories "[/\\\\]spack-manager/env-templates\\'") - (add-to-list 'lsp-file-watch-ignored-directories "[/\\\\]spack-manager/golds\\'") - (add-to-list 'lsp-file-watch-ignored-directories "[/\\\\]spack-manager/repos\\'") - (add-to-list 'lsp-file-watch-ignored-directories "[/\\\\]spack-manager/scripts\\'") - (add-to-list 'lsp-file-watch-ignored-directories "[/\\\\]spack-manager/spack\\'") - (add-to-list 'lsp-file-watch-ignored-directories "[/\\\\]spack-manager/spack-scripting\\'") - (add-to-list 'lsp-file-watch-ignored-directories "[/\\\\]spack-manager/stage\\'") - (add-to-list 'lsp-file-watch-ignored-directories "[/\\\\]spack-manager/tests\\'") + (add-to-list 'lsp-file-watch-ignored-directories "[/\\\\]exawind-manager/.cache\\'") + (add-to-list 'lsp-file-watch-ignored-directories "[/\\\\]exawind-manager/.tmp\\'") + (add-to-list 'lsp-file-watch-ignored-directories "[/\\\\]exawind-manager/configs\\'") + (add-to-list 'lsp-file-watch-ignored-directories "[/\\\\]exawind-manager/docs\\'") + (add-to-list 'lsp-file-watch-ignored-directories "[/\\\\]exawind-manager/env-templates\\'") + (add-to-list 'lsp-file-watch-ignored-directories "[/\\\\]exawind-manager/golds\\'") + (add-to-list 'lsp-file-watch-ignored-directories "[/\\\\]exawind-manager/repos\\'") + (add-to-list 'lsp-file-watch-ignored-directories "[/\\\\]exawind-manager/scripts\\'") + (add-to-list 'lsp-file-watch-ignored-directories "[/\\\\]exawind-manager/spack\\'") + (add-to-list 'lsp-file-watch-ignored-directories "[/\\\\]exawind-manager/spack-manager\\'") + (add-to-list 'lsp-file-watch-ignored-directories "[/\\\\]exawind-manager/spack-scripting\\'") + (add-to-list 'lsp-file-watch-ignored-directories "[/\\\\]exawind-manager/stage\\'") + (add-to-list 'lsp-file-watch-ignored-directories "[/\\\\]exawind-manager/tests\\'") ;; Increase garbage collection threshold ;; https://emacs-lsp.github.io/lsp-mode/page/performance/ diff --git a/dot_zshenv.tmpl b/dot_zshenv.tmpl index a70d810..345d5c7 100644 --- a/dot_zshenv.tmpl +++ b/dot_zshenv.tmpl @@ -44,10 +44,10 @@ fi export COMBUSTION_DIR="${HOME}/combustion" export MASA_HOME="${COMBUSTION_DIR}/install/MASA" -# spack-manager -if [ -d "${HOME}/exawind/spack-manager" ]; then - export SPACK_MANAGER=${HOME}/exawind/spack-manager - source ${SPACK_MANAGER}/start.sh +# exawind-manager +if [ -d "${HOME}/exawind/exawind-manager" ]; then + export EXAWIND_MANAGER=${HOME}/exawind/exawind-manager + source ${EXAWIND_MANAGER}/start.sh fi # pyenv