summaryrefslogtreecommitdiff
path: root/home
diff options
context:
space:
mode:
authorAlejandro Soto <alejandro@34project.org>2022-03-19 16:56:48 -0600
committerAlejandro Soto <alejandro@34project.org>2022-03-19 16:56:48 -0600
commit7793b7d8af601353e236252922abe84c5e9b79d0 (patch)
treefddecadbe93657cf5a1f8049895d321ed5ca0ff3 /home
parent1bf3639c5154701b264ca3f95b42c928dd11e345 (diff)
home: improve shenv infra
Diffstat (limited to 'home')
-rw-r--r--home/zshrc.nix8
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"