From 03cea9482aff09dce19192fa9ab4fe883fba210a Mon Sep 17 00:00:00 2001 From: thek4n Date: Wed, 12 Aug 2026 23:09:03 +0300 Subject: [PATCH] fix(nix): zsh plugin --- configs/.config/zsh/plugin | 6 +++--- configs/.config/zsh/prompt | 20 +------------------- configs/.config/zsh/sourcer | 4 ++-- hosts/default/configuration.nix | 2 +- 4 files changed, 7 insertions(+), 25 deletions(-) diff --git a/configs/.config/zsh/plugin b/configs/.config/zsh/plugin index 7e9941e..4138a35 100644 --- a/configs/.config/zsh/plugin +++ b/configs/.config/zsh/plugin @@ -3,9 +3,9 @@ install_if_not_exists() { - local path="${HOME}/.config/zsh/plugins/${1}" - if [ ! -d "${path}" ]; then - /usr/bin/git clone "https://github.com/${1}" "${path}" + local dir="${HOME}/.local/share/zsh/plugins/${1}" + if [ ! -d "${dir}" ]; then + /usr/bin/env git clone "https://github.com/${1}" "${dir}" fi } diff --git a/configs/.config/zsh/prompt b/configs/.config/zsh/prompt index 7dc0b4a..ed7d1d8 100644 --- a/configs/.config/zsh/prompt +++ b/configs/.config/zsh/prompt @@ -1,26 +1,8 @@ -# set a fancy prompt (non-color, unless we know we "want" color) case "$TERM" in xterm-color|*-256color) color_prompt=yes;; esac -# uncomment for a colored prompt, if the terminal has the capability; turned -# off by default to not distract the user: the focus in a terminal window -# should be on the output of commands, not on the prompt -force_color_prompt=yes - -if [ -n "$force_color_prompt" ]; then - if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then - # We have color support; assume it's compliant with Ecma-48 - # (ISO/IEC-6429). (Lack of such support is extremely rare, and such - # a case would tend to support setf rather than setaf.) - color_prompt=yes - else - color_prompt= - fi -fi - - setopt prompt_subst autoload -Uz vcs_info zstyle ':vcs_info:*' enable git cvs svn @@ -207,4 +189,4 @@ esac -PS2="> " \ No newline at end of file +PS2="> " diff --git a/configs/.config/zsh/sourcer b/configs/.config/zsh/sourcer index 4d26047..b334972 100644 --- a/configs/.config/zsh/sourcer +++ b/configs/.config/zsh/sourcer @@ -1,7 +1,7 @@ # vim: ft=zsh _so() { - [ -r "${1}" ] && [ -f "${1}" ] && source "${1}" + [ -r "${1}" ] && [ -e "${1}" ] && source "${1}" } _sod() { @@ -18,6 +18,7 @@ _sod() { } +_so "/etc/profile" source "${ZDOTDIR}/options" source "${ZDOTDIR}/completion" source "${ZDOTDIR}/history" @@ -25,7 +26,6 @@ source "${ZDOTDIR}/prompt" source "${ZDOTDIR}/other" source "${ZDOTDIR}/aliases" source "${ZDOTDIR}/functions" -_so "/etc/profile" _so "${ZDOTDIR}/hosts/${HOST}" diff --git a/hosts/default/configuration.nix b/hosts/default/configuration.nix index 32d026b..ef77c4f 100644 --- a/hosts/default/configuration.nix +++ b/hosts/default/configuration.nix @@ -24,7 +24,7 @@ man mpv noto-fonts p7zip poppler resvg ripgrep rofi slurp socat sway swaybg swayidle swaylock tmux tree-sitter ueberzug waybar wget wl-clipboard wlr-randr wtype yazi ydotool zoxide - docker httpie + docker httpie home-manager ]; programs.zsh = {