diff --git a/default.conf.yaml b/default.conf.yaml index c7a5810..4b48be1 100644 --- a/default.conf.yaml +++ b/default.conf.yaml @@ -26,12 +26,12 @@ ~/.gitattributes: git/gitattributes ~/.gitignore: git/gitignore ~/.my.cnf: mysql/.my.cnf + ~/.profile: etc/profile ~/.psqlrc: psql/.psqlrc ~/.task/hooks: task/hooks/ ~/.taskrc: task/.taskrc ~/.tmux.conf: tmux/.tmux.conf ~/.vimrc: vim/.vimrc ~/.vim: vim/ - ~/.zprofile: zsh/.zprofile ~/.zshenv: zsh/.zshenv ~/.zshrc: zsh/.zshrc diff --git a/etc/profile b/etc/profile new file mode 100644 index 0000000..996e845 --- /dev/null +++ b/etc/profile @@ -0,0 +1,24 @@ +source_if() { + if [ -e "$1" ]; then + source "$1" + fi +} + +path_if() { + if [ -d "$1" ]; then + case ":$PATH:" in + *:"$1":*) + ;; + *) + PATH="${1}${PATH:+:$PATH}" + esac + fi +} + +source_if "${HOME}/.nix-profile/etc/profile.d/nix.sh" + +path_if "$HOME/bin" +path_if "$HOME/.local/bin" + +unset -f source_if +unset -f path_if diff --git a/zsh/.zprofile b/zsh/.zprofile deleted file mode 100644 index cb65dcd..0000000 --- a/zsh/.zprofile +++ /dev/null @@ -1,13 +0,0 @@ -#!/usr/bin/env zsh - -if [ -e "${HOME}/.nix-profile/etc/profile.d/nix.sh" ]; then - source "${HOME}/.nix-profile/etc/profile.d/nix.sh" -fi - -if [ -d "$HOME/bin" ] ; then - PATH="$HOME/bin:$PATH" -fi - -if [ -d "$HOME/.local/bin" ] ; then - PATH="$HOME/.local/bin:$PATH" -fi