diff --git a/config/shell/zsh/.zprofile b/config/shell/zsh/.zprofile new file mode 100644 index 0000000..cf82de4 --- /dev/null +++ b/config/shell/zsh/.zprofile @@ -0,0 +1,3 @@ +__HOME_ZPROFILE_SOURCED=1 +[[ -f "/etc/profile" ]] && emulate sh -c "source /etc/profile" +[[ -f "~/.profile" ]] && emulate sh -c "source ~/.profile" \ No newline at end of file diff --git a/config/shell/zsh/zshrc b/config/shell/zsh/.zshrc similarity index 95% rename from config/shell/zsh/zshrc rename to config/shell/zsh/.zshrc index de42208..94d8cf3 100644 --- a/config/shell/zsh/zshrc +++ b/config/shell/zsh/.zshrc @@ -1,3 +1,5 @@ +__HOME_ZSHRC_SOURCED=1 + if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" fi @@ -7,8 +9,8 @@ if [ -n "$EAT_SHELL_INTEGRATION_DIR" ]; then source "$EAT_SHELL_INTEGRATION_DIR/zsh"; fi -export ZSH_DATA_DIR="${XDG_CONFIG_HOME:-"$HOME/.config"}/zsh/data" -export ZSH_CONFIG_DIR="${XDG_CONFIG_HOME:-"$HOME/.config"}/zsh/cfg" +ZSH_DATA_DIR="${XDG_CONFIG_HOME:-"$HOME/.config"}/zsh/data" +ZSH_CONFIG_DIR="${XDG_CONFIG_HOME:-"$HOME/.config"}/zsh/cfg" #Check if terminal is fullcolor if zmodload zsh/terminfo && (( "$terminfo[colors]" >= "256" )); then @@ -19,7 +21,7 @@ fi #MSYS if [[ "$(uname -s)" =~ ^MSYS_NT.* ]]; then #Use windows symlink instead copy - export MSYS=winsymlinks:nativestrict + MSYS=winsymlinks:nativestrict fi diff --git a/config/shell/zsh/zshenv b/config/shell/zsh/zshenv index 8a3197b..53e8e87 100644 --- a/config/shell/zsh/zshenv +++ b/config/shell/zsh/zshenv @@ -1 +1,5 @@ -__MATERUS_HM_ZSH=1 \ No newline at end of file +#TODO: Set ZDOTDIR based on MKK_CONFIG_PATH + +__HOME_ZSHENV_SOURCED=1 +ZDOTDIR=${XDG_CONFIG_HOME:-"$HOME/.config"}/zsh/cfg +setopt no_global_rcs \ No newline at end of file diff --git a/nix-config/home/materus/default.nix b/nix-config/home/materus/default.nix index 75cfd8f..836a12b 100644 --- a/nix-config/home/materus/default.nix +++ b/nix-config/home/materus/default.nix @@ -14,7 +14,6 @@ home.file = { - ".zshrc".source = "${config.xdg.configFile."zsh/cfg".source}/zshrc"; ".zshenv".source = "${config.xdg.configFile."zsh/cfg".source}/zshenv"; ".tmux.conf".source = "${config.mkk.dir}/config/tmux/tmux.conf"; }; diff --git a/nix-config/host/materusPC/configuration.nix b/nix-config/host/materusPC/configuration.nix index 0479542..b13245c 100644 --- a/nix-config/host/materusPC/configuration.nix +++ b/nix-config/host/materusPC/configuration.nix @@ -279,7 +279,7 @@ in enable = true; enableGlobalCompInit = false; interactiveShellInit = '' - if [[ ''${__MATERUS_HM_ZSH:-0} == 0 ]]; then + if [[ ''${__HOME_ZSHRC_SOURCED:-0} == 0 ]]; then source ${pkgs.grml-zsh-config}/etc/zsh/zshrc fi '';