From 8d9870404dae3a0a5c8fe6dcd41c0dd0e9f234f8 Mon Sep 17 00:00:00 2001 From: Ivan Malison Date: Wed, 30 May 2018 22:11:41 -0700 Subject: [PATCH] Update PATH configuration for NixOS --- dotfiles/bash_profile | 2 +- dotfiles/lib/login.sh | 3 ++- dotfiles/lib/nix_login.sh | 4 ++++ dotfiles/lib/shellenv.sh | 12 ++++++++++++ dotfiles/zprofile | 1 + rcm-link.sh | 2 +- 6 files changed, 21 insertions(+), 3 deletions(-) create mode 100644 dotfiles/lib/nix_login.sh create mode 100644 dotfiles/lib/shellenv.sh create mode 100644 dotfiles/zprofile diff --git a/dotfiles/bash_profile b/dotfiles/bash_profile index 86795d70..6cd8b53a 100644 --- a/dotfiles/bash_profile +++ b/dotfiles/bash_profile @@ -1 +1 @@ -source ~/.bashrc +source ~/.lib/login.sh diff --git a/dotfiles/lib/login.sh b/dotfiles/lib/login.sh index 1e7b4bf8..0a82b36c 100644 --- a/dotfiles/lib/login.sh +++ b/dotfiles/lib/login.sh @@ -1,5 +1,6 @@ source "$HOME/.lib/shellpath.sh" -setup_unless_environment_variable_exists ENV_PATH_SETUP_DONE || _setup_path +# XXX: This is duplicated from env with a different var to avoid issues with /etc/profile +command_exists python && setup_unless_environment_variable_exists LOGIN_PATH_SETUP_DONE _setup_path source_directory_files "$HOME/.lib/login" diff --git a/dotfiles/lib/nix_login.sh b/dotfiles/lib/nix_login.sh new file mode 100644 index 00000000..ccf4f046 --- /dev/null +++ b/dotfiles/lib/nix_login.sh @@ -0,0 +1,4 @@ +source "$HOME/.lib/shellpath.sh" + +command_exists python && setup_unless_environment_variable_exists NIX_PATH_SETUP_DONE _setup_path + diff --git a/dotfiles/lib/shellenv.sh b/dotfiles/lib/shellenv.sh new file mode 100644 index 00000000..8fe71607 --- /dev/null +++ b/dotfiles/lib/shellenv.sh @@ -0,0 +1,12 @@ +source "$HOME/.lib/shellpath.sh" + +# XXX: This PATH setup var is only actually set in login.sh which is definitely +# strange. The reason for this is that because env runs BEFORE profile, things +# in places like /etc/profile can actually clobber the path setup that we do. + +# Disbled setup here. Doing it in profile instead +if command_exists python; then + environment_variable_exists LOGIN_PATH_SETUP_DONE || setup_unless_environment_variable_exists ENV_PATH_SETUP_DONE _setup_path +fi + +source_directory_files "$HOME/.lib/shellenv" diff --git a/dotfiles/zprofile b/dotfiles/zprofile new file mode 100644 index 00000000..6cd8b53a --- /dev/null +++ b/dotfiles/zprofile @@ -0,0 +1 @@ +source ~/.lib/login.sh diff --git a/rcm-link.sh b/rcm-link.sh index f9154001..d17fe704 100755 --- a/rcm-link.sh +++ b/rcm-link.sh @@ -5,4 +5,4 @@ export THIS_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" export DOTFILES_DIR="$(readlink -f $THIS_DIR/dotfiles)" echo $DOTFILES_DIR -rcup -d $DOTFILES_DIR -S "emacs.d" -S "config/taffybar" -S "config/xmonad" -S "config/xmonad/taffybar" +rcup -d $DOTFILES_DIR -S "emacs.d" -S "config/taffybar" -S "config/xmonad" -S "config/xmonad/taffybar" -S "lib"