diff options
| author | Alejandro Soto <alejandro@34project.org> | 2022-03-19 16:56:48 -0600 |
|---|---|---|
| committer | Alejandro Soto <alejandro@34project.org> | 2022-03-19 16:56:48 -0600 |
| commit | 7793b7d8af601353e236252922abe84c5e9b79d0 (patch) | |
| tree | fddecadbe93657cf5a1f8049895d321ed5ca0ff3 /home/zshrc.nix | |
| parent | 1bf3639c5154701b264ca3f95b42c928dd11e345 (diff) | |
home: improve shenv infra
Diffstat (limited to '')
| -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" |
