Skip to content

Commit

Permalink
(zsh): Correct omz dotfiles
Browse files Browse the repository at this point in the history
- Use brew env var to determine the path
- Use ggc-14
  • Loading branch information
thibmaek committed Jun 17, 2024
1 parent 6c52074 commit 4e23421
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 17 deletions.
2 changes: 1 addition & 1 deletion roles/zsh/templates/dotfiles/aliases.zsh.j2
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ alias ls="eza"
alias lsa="ls -aF"
alias lf="lsa | fzf"
alias lsd="ls -lF | grep '^d'"
alias gcc="gcc-10"
alias gcc="gcc-14"
{% if ansible_os_family == "Darwin" %}
alias rm="trash"
alias textedit="open -a TextEdit"
Expand Down
33 changes: 17 additions & 16 deletions roles/zsh/templates/dotfiles/exports.zsh.j2
Original file line number Diff line number Diff line change
Expand Up @@ -2,35 +2,36 @@
# Folder aliases
export DOCKER_COMPOSE_DIR="{{ docker_compose_dir }}"
export SYSTEMD_DIR="/etc/systemd/system"
export CONFIG_DIR="{{ ansible_env.HOME }}/.config"

{% endif %}
{% if ansible_os_family == 'Darwin' %}
# Use brew command-not-found
HB_CNF_HANDLER="$(brew --repository)/Library/Taps/homebrew/homebrew-command-not-found/handler.sh"
HB_CNF_HANDLER="$brew_prefix/Library/Taps/homebrew/homebrew-command-not-found/handler.sh"
if [ -f "$HB_CNF_HANDLER" ]; then
source "$HB_CNF_HANDLER";
fi

# Use brew sbin to path
export PATH="/usr/local/sbin:$PATH"
export PATH="$brew_prefix/sbin:$PATH"

# Prefer GNU tools over BSD (default) tools
export PATH="/usr/local/opt/findutils/libexec/gnubin:$PATH"
export PATH="/usr/local/opt/coreutils/libexec/gnubin:$PATH"
export PATH="/usr/local/opt/make/libexec/gnubin:$PATH"
export PATH="/usr/local/opt/curl/bin:$PATH"
export PATH="/usr/local/opt/unzip/bin:$PATH"
export PATH="$brew_prefix/opt/findutils/libexec/gnubin:$PATH"
export PATH="$brew_prefix/opt/coreutils/libexec/gnubin:$PATH"
export PATH="$brew_prefix/opt/make/libexec/gnubin:$PATH"
export PATH="$brew_prefix/opt/curl/bin:$PATH"
export PATH="$brew_prefix/opt/unzip/bin:$PATH"

export LDFLAGS="-L/usr/local/opt/curl/lib"

export CPPFLAGS="-I/usr/local/opt/curl/include"

export PKG_CONFIG_PATH="/usr/local/opt/curl/lib/pkgconfig"
export LDFLAGS="-L$brew_prefix/opt/curl/lib"
export CPPFLAGS="-I$brew_prefix/opt/curl/include"
export PKG_CONFIG_PATH="$brew_prefix/opt/curl/lib/pkgconfig"

{% endif %}
# Set default editor to neovim
export EDITOR=nvim
# Set default editor to neovim if available, otherwise nano
if command -v nvim > /dev/null; then
export EDITOR=nvim
else
export EDITOR=nano
fi

# Add ~/bin to the path for local CLI/binaries/scripts
export PATH="$HOME/bin:$PATH";
export PATH="$HOME/bin:$PATH"

0 comments on commit 4e23421

Please sign in to comment.