diff options
Diffstat (limited to 'home')
| -rw-r--r-- | home/zshrc.nix | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/home/zshrc.nix b/home/zshrc.nix index 39b34ff..85cdc95 100644 --- a/home/zshrc.nix +++ b/home/zshrc.nix @@ -43,8 +43,10 @@ INSTALLABLES=() while read -d: PATH_ITEM; do - if [[ "$PATH_ITEM" =~ "^/nix/store/[a-z0-9]+-([a-zA-Z][a-zA-Z0-9_]*(-[a-zA-Z][a-zA-Z0-9_]*)*)" ]]; then - INSTALLABLES+=("''${match[1]}") + if [[ "$PATH_ITEM" =~ "^(/nix/store/[a-z0-9]+-([a-zA-Z][a-zA-Z0-9_]*(-[a-zA-Z][a-zA-Z0-9_]*)*)(-[^/]+)?)/" ]]; then + ENTER="''${match[1]}/lib/shenv/enter" + [[ "''${match[2]}" =~ '^shenv-' && -r "$ENTER" ]] && . "$ENTER" + INSTALLABLES+=("''${match[2]}") fi done <<<"$PATH" @@ -52,7 +54,7 @@ _GRML_NIX_SHELL="{''${INSTALLABLES[@]}} " fi - unset INSTALLABLES PATH_ITEM + unset INSTALLABLES ENTER PATH_ITEM function grml_nix_shell() { REPLY="$_GRML_NIX_SHELL" |
