Move environment variables into separate files per program/language

This commit is contained in:
crater2150 2019-02-11 16:05:04 +01:00
parent 6d287ef6d0
commit c9b5475e41
8 changed files with 17 additions and 49 deletions

1
env/10_path.zsh vendored Normal file
View file

@ -0,0 +1 @@
export PATH="$PATH:$HOME/.local/bin"

3
env/40_mail.zsh vendored Normal file
View file

@ -0,0 +1,3 @@
export MAILDIR=$HOME/.maildir
export NOTMUCH_CONFIG=$XDG_CONFIG_HOME/notmuch-config
export GNUPGHOME="$XDG_CONFIG_HOME"/gnupg

3
env/50_nodejs.zsh vendored Normal file
View file

@ -0,0 +1,3 @@
export NPM_PACKAGES="${XDG_DATA_HOME}/npm-packages"
export NODE_PATH="$NPM_PACKAGES/lib/node_modules:$NODE_PATH"
export PATH="$PATH:$NPM_PACKAGES/bin"

2
env/50_ruby.zsh vendored Normal file
View file

@ -0,0 +1,2 @@
RUBY_VERSION=${$(gem environment gemdir):t}
export PATH="$PATH:$HOME/.gem/ruby/$RUBY_VERSION/bin"

3
env/50_rust.zsh vendored Normal file
View file

@ -0,0 +1,3 @@
if which rustup &>/dev/null; then
export RUST_SRC_PATH=$(rustup run stable rustc --print sysroot)/lib/rustlib/src/rust/src
fi

1
env/60_fzf.zsh vendored Normal file
View file

@ -0,0 +1 @@
export FZF_DEFAULT_COMMAND="fd"

View file

@ -1,29 +0,0 @@
# path to your zsh configuration dir
# this may be the path to this repo, if you use it per user
# if you installed this repo to /etc/zsh/, this is the path for the per user
# config, which can override global settings in /etc/zsh
export ZDOTDIR=$HOME/.config/zsh
PROMPT_UNICODE=yes
# below you can put user or server specific settings.
# on foreign server I don't want to accidentaly alarm admins
#sudo() {
# echo "no root here";
#}
#
#su() {
# echo "no root here";
#}
# set modules to load. here: exclude highlight, because it is no fun over slow
# connections
#ZMODLOAD_ONLY=( autoloader bindings completion vcs prompt )
# make some programs use xdg basedirs
#export MAILDIR=$HOME/.maildir export NOTMUCH_CONFIG=$HOME/.config/notmuch-config
#export VIMINIT="let \$MYVIMRC=\"$XDG_CONFIG_HOME/vim/vimrc\" | source \$MYVIMRC"
#export GVIMINIT="let \$MYGVIMRC=\"$XDG_CONFIG_HOME/vim/gvimrc\" | source \$MYGVIMRC"
#export GNUPGHOME="$XDG_CONFIG_HOME"/gnupg

24
zshenv
View file

@ -1,24 +1,8 @@
export ZDOTDIR=$HOME/.config/zsh
export ZDOTDIR=${XDG_CONFIG_HOME:-$HOME/.config}/zsh
ZMODLOAD_BLACKLIST=( ssh-agent )
export ZMODLOAD_BLACKLIST
if [ -n "$TMUX" ]; then export SHELL=/usr/bin/tmux; fi
export MAILDIR=$HOME/.maildir export NOTMUCH_CONFIG=$HOME/.config/notmuch-config
export GNUPGHOME="$XDG_CONFIG_HOME"/gnupg
export FZF_DEFAULT_COMMAND="fd"
export NPM_PACKAGES="${XDG_DATA_HOME}/npm-packages"
export NODE_PATH="$NPM_PACKAGES/lib/node_modules:$NODE_PATH"
PATH="$PATH:$HOME/.gem/ruby/2.5.0/bin"
PATH="$PATH:$NPM_PACKAGES/bin"
PATH="$PATH:$HOME/.local/bin"
PATH="$PATH:$XDG_DATA_HOME/android/sdk/tools"
export PATH
if command -v rustup &>/dev/null; then
export RUST_SRC_PATH=$(rustup run stable rustc --print sysroot)/lib/rustlib/src/rust/src
fi
for i in $ZDOTDIR/env/*.zsh; do
. $i
done
if [[ -e $ZDOTDIR/dirs ]]; then
source $ZDOTDIR/dirs