Skip to content

Commit

Permalink
zsh: Try splitting zprofile by OS
Browse files Browse the repository at this point in the history
  • Loading branch information
jdkaplan committed Sep 26, 2024
1 parent 60faca0 commit 8599d7c
Show file tree
Hide file tree
Showing 7 changed files with 40 additions and 13 deletions.
4 changes: 2 additions & 2 deletions darwin.conf.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
- shell:
-
command: brew/install
- command: brew/install
stdout: true
stderr: true
quiet: false
Expand All @@ -12,3 +11,4 @@
~/.config/aerospace: aerospace/
~/.config/karabiner: karabiner/
~/.config/tridactyl: tridactyl/
~/.profile: etc/profile.darwin
2 changes: 0 additions & 2 deletions default.conf.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,10 @@
~/.ignore: etc/ignore
~/.my.cnf: mysql/.my.cnf
~/.npmrc: npm/.npmrc
~/.profile: etc/profile
~/.psqlrc: psql/.psqlrc
~/.rgignore: etc/rgignore
~/.tmux.conf: tmux/.tmux.conf
~/.vimrc: vim/.vimrc
~/.vim: vim/
~/.zprofile: zsh/.zprofile
~/.zshenv: zsh/.zshenv
~/.zshrc: zsh/.zshrc
8 changes: 0 additions & 8 deletions etc/profile

This file was deleted.

4 changes: 4 additions & 0 deletions zsh/.zprofile → etc/profile.darwin
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
has() {
command -V "$1" > /dev/null 2>&1
}

source_if() {
if [ -e "$1" ]; then
source "$1"
Expand Down
33 changes: 33 additions & 0 deletions etc/profile.linux
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
has() {
command -V "$1" > /dev/null 2>&1
}

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

if has gnome-keyring-daemon; then
eval "$(gnome-keyring-daemon --start)"
export SSH_AUTH_SOCK
fi
1 change: 1 addition & 0 deletions linux.conf.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
- link:
~/.config/user-dirs.dirs: etc/user-dirs.dirs
~/.profile: etc/profile.linux
./alacritty/os.toml: alacritty/linux.toml
./zsh/os.zshrc: zsh/linux.zshrc
1 change: 0 additions & 1 deletion zsh/.zshrc
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ ${prompt}"
export RPROMPT=''

# aliases
source $HOME/.zprofile
source $HOME/.config/zsh/aliases

source $HOME/.config/zsh/j.sh
Expand Down

0 comments on commit 8599d7c

Please sign in to comment.