2021-07-01 21:42:48 -04:00
|
|
|
#!/usr/bin/sh
|
|
|
|
|
|
|
|
# Common startup shell script
|
|
|
|
|
|
|
|
# Don't re-run this script
|
|
|
|
# [ -n "$E_STARTED" ] || . $HOME/.config/shell/start.sh
|
|
|
|
export E_SCRIPTS_DIR="$HOME/.config/shell"
|
|
|
|
|
|
|
|
export XDG_CONFIG_HOME="$HOME/.config"
|
|
|
|
export XDG_USER_CONFIG_DIR="$XDG_CONFIG_HOME"
|
|
|
|
export XDG_DATA_HOME="$HOME/.local/share"
|
|
|
|
export XDG_CACHE_HOME="$HOME/.cache"
|
|
|
|
|
2021-08-02 19:43:37 -04:00
|
|
|
# NixOS home-manager desktop files "fix"
|
|
|
|
export XDG_DATA_DIRS="$HOME/.nix-profile/share:$XDG_DATA_DIRS"
|
|
|
|
|
2021-07-01 21:42:48 -04:00
|
|
|
export LANG=en_CA.UTF-8
|
|
|
|
# TZ
|
|
|
|
|
2021-07-03 11:19:37 -04:00
|
|
|
export EDITOR=nvim
|
|
|
|
|
2021-07-01 21:42:48 -04:00
|
|
|
# functions to add directories to $PATH
|
|
|
|
path_add(){
|
|
|
|
PATH="$1:$PATH"
|
|
|
|
}
|
|
|
|
|
|
|
|
path_add_end(){
|
|
|
|
PATH="$PATH:$1"
|
|
|
|
}
|
|
|
|
|
|
|
|
# Avoid having too many things in ~/ -----------------------
|
|
|
|
path_add "$HOME/.local/bin"
|
|
|
|
path_add "$HOME/.config/shell/bin"
|
|
|
|
|
2021-07-30 00:32:03 -04:00
|
|
|
# Doom Emacs
|
|
|
|
path_add "$HOME/.config/emacs/bin"
|
|
|
|
|
2021-07-01 21:42:48 -04:00
|
|
|
# Rust, cargo
|
|
|
|
export CARGO_HOME="$XDG_DATA_HOME/cargo"
|
|
|
|
[ -f $CARGO_HOME/env ] && . "$CARGO_HOME/env"
|
|
|
|
|
|
|
|
# golang
|
|
|
|
path_add "/usr/local/go/bin"
|
|
|
|
export GOPROXY=direct
|
|
|
|
export GOPATH="$XDG_DATA_HOME/go"
|
|
|
|
path_add "$GOPATH/bin"
|
|
|
|
|
|
|
|
# node, npm, yarn
|
2021-07-24 10:24:23 -04:00
|
|
|
export NVM_DIR="$HOME/.config/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
|
|
|
|
|
2021-07-01 21:42:48 -04:00
|
|
|
export NPM_CONFIG_USERCONFIG="$XDG_CONFIG_HOME/npm/npmrc"
|
|
|
|
|
|
|
|
|
|
|
|
alias wget="wget --hsts-file=$XDG_CACHE_HOME/wget-hsts"
|
2021-08-02 19:43:37 -04:00
|
|
|
# export GNUPGHOME="$XDG_DATA_HOME/gnupg" # Causes issues on NixOS
|
2021-07-01 21:42:48 -04:00
|
|
|
|
|
|
|
|
|
|
|
export PATH # just in case
|
|
|
|
|
|
|
|
# Note that this script has been run
|
|
|
|
export E_STARTED=1
|