diff --git a/common.sh b/dot_common.sh similarity index 71% rename from common.sh rename to dot_common.sh index 162f556..247d8e3 100644 --- a/common.sh +++ b/dot_common.sh @@ -2,3 +2,4 @@ # Should not be executable, only sourced by other scripts command_exists() { command -v ${1} >/dev/null; } +source_if_exists() { [ -f "$1" ] && source $1; } diff --git a/dot_zshrc b/dot_zshrc index 1bdeba5..fbea379 100644 --- a/dot_zshrc +++ b/dot_zshrc @@ -1,5 +1,7 @@ -source $HOME/.local/scripts/zsh/zsh-prelude.zsh -source $HOME/.local/scripts/zsh/check-update.zsh +source $HOME/.common.sh + +source_if_exists $HOME/.local/scripts/zsh/zsh-prelude.zsh +source_if_exists $HOME/.local/scripts/zsh/check-update.zsh export LANG=en_US.UTF-8 @@ -21,8 +23,8 @@ export DOTNET_CLI_TELEMETRY_OPTOUT=1 export EDITOR=nvim export MAILDIR=$HOME/Mail -source $HOME/.cargo/env -source $HOME/.ghcup/env +source_if_exists $HOME/.cargo/env +source_if_exists $HOME/.ghcup/env export PATH="$HOME/.local/bin:$HOME/.local/scripts:$HOME/.dotnet/tools:$PATH:$HOME/go/bin:$HOME/.idris2/bin" [ -f "${GHCUP_INSTALL_BASE_PREFIX:=$HOME}/.ghcup/env" ] && source "${GHCUP_INSTALL_BASE_PREFIX:=$HOME}/.ghcup/env" @@ -44,7 +46,7 @@ if [ "${gnupg_SSH_AUTH_SOCK_by:-0}" -ne $$ ]; then export SSH_AUTH_SOCK="$(gpgconf --list-dirs agent-ssh-socket)" fi -source $HOME/.local/scripts/zsh/aliases.zsh -source $HOME/.zsh/extras/*.zsh +source_if_exists $HOME/.local/scripts/zsh/aliases.zsh +[ -f "$HOME/.zsh/extras" ] && source $HOME/.zsh/extras/*.zsh # vim: set filetype=zsh: diff --git a/executable_dot_profile b/executable_dot_profile new file mode 100644 index 0000000..8dd2914 --- /dev/null +++ b/executable_dot_profile @@ -0,0 +1,6 @@ + +export PATH="$HOME/.cargo/bin:/usr/local/go/bin:$PATH" +export TERMINAL="/usr/bin/alacritty" +export EDITOR="/usr/bin/nvim" + +# vim: set ft=bash : diff --git a/run_once_01_install_packages.sh.tmpl b/run_once_01_install_packages.sh.tmpl new file mode 100644 index 0000000..00dc09e --- /dev/null +++ b/run_once_01_install_packages.sh.tmpl @@ -0,0 +1,11 @@ +#!/bin/bash + +{{ if eq .chezmoi.osRelease.id "arch" }} + sudo pacman -Syy --needed \ + feh \ + git \ + zsh \ + && true +{{ end }} + +# vim: set ft=bash : diff --git a/run_once_01_cargo_bins.sh b/run_once_02_cargo_bins.sh similarity index 100% rename from run_once_01_cargo_bins.sh rename to run_once_02_cargo_bins.sh