mirror of
https://github.com/ivuorinen/dotfiles.git
synced 2026-01-26 03:04:06 +00:00
145 lines
4.0 KiB
Bash
Executable File
145 lines
4.0 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
# shellcheck shell=bash
|
|
# shellcheck enable=external-sources
|
|
# shellcheck disable=1091,2139
|
|
# vim: filetype=zsh
|
|
export DOTFILES="$HOME/.dotfiles"
|
|
source "$DOTFILES/scripts/shared.sh"
|
|
|
|
# Antigen configuration
|
|
# https://github.com/zsh-users/antigen/wiki/Configuration
|
|
export ADOTDIR="$XDG_DATA_HOME/antigen"
|
|
export ANTIGEN_SYSTEM_RECEIPT_F=".local/share/antigen/antigen_system_lastupdate"
|
|
export ANTIGEN_PLUGIN_RECEIPT_F=".local/share/antigen/antigen_plugin_lastupdate"
|
|
|
|
# Ansible configuration
|
|
# https://docs.ansible.com/ansible/latest/reference_appendices/config.html
|
|
export ANSIBLE_HOME="$XDG_CONFIG_HOME/ansible"
|
|
export ANSIBLE_CONFIG="$XDG_CONFIG_HOME/ansible.cfg"
|
|
export ANSIBLE_GALAXY_CACHE_DIR="$XDG_CACHE_HOME/ansible/galaxy_cache"
|
|
have ansible && {
|
|
x-dc "$ANSIBLE_HOME"
|
|
x-dc "$ANSIBLE_GALAXY_CACHE_DIR"
|
|
}
|
|
|
|
export ANDROID_HOME="$XDG_DATA_HOME/android"
|
|
|
|
# composer, https://getcomposer.org/
|
|
export COMPOSER_HOME="$XDG_STATE_HOME/composer"
|
|
export COMPOSER_BIN="$COMPOSER_HOME/vendor/bin"
|
|
have composer && {
|
|
export PATH="$COMPOSER_BIN:$PATH"
|
|
}
|
|
|
|
# docker, https://docs.docker.com/engine/reference/commandline/cli/
|
|
export DOCKER_CONFIG="$XDG_CONFIG_HOME/docker"
|
|
have docker && {
|
|
x-dc "$DOCKER_CONFIG"
|
|
# Docker: Disable snyk ad
|
|
export DOCKER_SCAN_SUGGEST=false
|
|
}
|
|
|
|
# ffmpeg
|
|
export FFMPEG_DATADIR="$XDG_CONFIG_HOME/ffmpeg"
|
|
have ffmpeg && x-dc "$FFMPEG_DATADIR"
|
|
|
|
# gcloud
|
|
have gcloud && {
|
|
GCLOUD_LOC=$(gcloud info --format="value(installation.sdk_root)" --quiet)
|
|
[[ -f "$GCLOUD_LOC/path.zsh.inc" ]] && builtin source "$GCLOUD_LOC/path.zsh.inc"
|
|
[[ -f "$GCLOUD_LOC/completion.zsh.inc" ]] && builtin source "$GCLOUD_LOC/completion.zsh.inc"
|
|
}
|
|
|
|
# GnuPG
|
|
export GNUPGHOME="$XDG_DATA_HOME/gnupg"
|
|
|
|
# Go
|
|
export GOPATH="$XDG_DATA_HOME/go"
|
|
export GOBIN="$XDG_BIN_HOME"
|
|
|
|
# irssi
|
|
have irssi && {
|
|
# These variables are used in ./alias with --config and --home
|
|
export IRSSI_CONFIG_HOME="$XDG_CONFIG_HOME/irssi"
|
|
export IRSSI_CONFIG_FILE="$IRSSI_CONFIG_HOME/config"
|
|
x-dc "$IRSSI_CONFIG_HOME"
|
|
}
|
|
|
|
# nb, https://xwmx.github.io/nb/
|
|
export NBRC_PATH="$XDG_CONFIG_HOME/nbrc"
|
|
export NB_DIR="$XDG_STATE_HOME/nb"
|
|
|
|
# nvm, the node version manager
|
|
export NVM_LAZY_LOAD=true
|
|
export NVM_COMPLETION=true
|
|
export NVM_AUTO_USE=true
|
|
export NVM_DIR="$XDG_CONFIG_HOME/nvm"
|
|
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
|
|
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
|
|
|
|
# Add npm packages to path
|
|
have node && {
|
|
NVM_NODE_BIN_DIR="$(dirname "$(which node)")"
|
|
path_append "$NVM_NODE_BIN_DIR"
|
|
}
|
|
|
|
# op (1Password cli) is present
|
|
export OP_CACHE="$XDG_STATE_HOME/1password"
|
|
have op && {
|
|
eval "$(op completion zsh)"
|
|
compdef _op op
|
|
}
|
|
|
|
# Python
|
|
#
|
|
# pyenv, python environments
|
|
export WORKON_HOME="$XDG_DATA_HOME/virtualenvs"
|
|
export PYENV_ROOT="$XDG_STATE_HOME/pyenv"
|
|
have pyenv && {
|
|
path_append "$(pyenv root)/shims"
|
|
path_append "$PYENV_ROOT/bin"
|
|
eval "$(pyenv init -)"
|
|
}
|
|
|
|
# Ruby
|
|
#
|
|
# including: bundler, rbenv
|
|
export GEM_HOME="${XDG_DATA_HOME}"/gem
|
|
export GEM_SPEC_CACHE="${XDG_CACHE_HOME}"/gem
|
|
export BUNDLE_USER_CONFIG="$XDG_CONFIG_HOME"/bundle
|
|
export BUNDLE_USER_CACHE="$XDG_CACHE_HOME"/bundle
|
|
export BUNDLE_USER_PLUGIN="$XDG_DATA_HOME"/bundle
|
|
export RBENV_ROOT="$XDG_STATE_HOME/rbenv"
|
|
x-dc "$RBENV_ROOT"
|
|
have gem && path_append "$(gem environment gemdir)/bin"
|
|
have rbenv && eval "$(rbenv init - zsh)"
|
|
|
|
# Rust / cargo
|
|
export CARGO_HOME="$XDG_STATE_HOME/cargo"
|
|
path_append "$CARGO_HOME/bin"
|
|
|
|
# screen
|
|
export SCREENRC="$XDG_CONFIG_HOME/misc/screenrc"
|
|
|
|
# sonarlint
|
|
export SONARLINT_USER_HOME="$XDG_DATA_HOME/sonarlint"
|
|
|
|
# tldr / tealdeer
|
|
export TEALDEER_CONFIG_DIR="$XDG_CONFIG_HOME/tealdeer/"
|
|
|
|
# tmux
|
|
export TMUX_CONF="$XDG_CONFIG_HOME/tmux/tmux.conf"
|
|
|
|
# wakatime, https://github.com/wakatime/wakatime-cli
|
|
export WAKATIME_HOME="$XDG_STATE_HOME/wakatime"
|
|
x-dc "$WAKATIME_HOME"
|
|
|
|
# z, https://github.com/rupa/z
|
|
export _Z_DATA="$XDG_STATE_HOME/z"
|
|
[[ -f "$XDG_BIN_HOME/z/z.sh" ]] && source "$XDG_BIN_HOME/z/z.sh"
|
|
|
|
# Misc
|
|
export BAT_THEME="ansi"
|
|
export CHEAT_USE_FZF=true
|
|
export SQLITE_HISTORY="$XDG_CACHE_HOME"/sqlite_history
|