From e160c24728bad4076f148b0a31de92f88df365d8 Mon Sep 17 00:00:00 2001 From: Akshay Nair Date: Thu, 3 Mar 2022 23:09:03 +0530 Subject: config sync --- config/zsh/aliases/dev.zsh | 25 +++++++++++++++++++++++++ config/zsh/zshrc | 3 +++ 2 files changed, 28 insertions(+) (limited to 'config/zsh') diff --git a/config/zsh/aliases/dev.zsh b/config/zsh/aliases/dev.zsh index 6a9d8f3..4b6108b 100644 --- a/config/zsh/aliases/dev.zsh +++ b/config/zsh/aliases/dev.zsh @@ -73,3 +73,28 @@ p__load_nix_shell_file() { zle -N p__load_nix_shell_file; bindkey '^N' p__load_nix_shell_file; + + +# Enter shell +p__enter_nixshell() { + if [[ -f "./default.nix" ]] || [[ -f "./shell.nix" ]]; then + shell="nix-zsh" + if [[ -f "./shell.nix" ]]; then + shell="nix-zsh ./shell.nix" + fi + $shell + zle send-break + return 0; + else + echo ""; + echo "ERR: default.nix already exists in directory"; + zle send-break; + return 1; + fi; +} + +zle -N p__enter_nixshell; +bindkey '^X' p__enter_nixshell; + +alias fix-interpreter="nix-shell -p patchelf --run 'patchelf --set-interpreter \$(patchelf --print-interpreter \$(which mkdir))'" + diff --git a/config/zsh/zshrc b/config/zsh/zshrc index c3fde13..9bf0e26 100644 --- a/config/zsh/zshrc +++ b/config/zsh/zshrc @@ -18,6 +18,9 @@ export ZSH_CUSTOM_CONF_FILES="$HOME/.config/zsh"; for f in $ZSH_CUSTOM_CONF_FILES/*.zsh; do source $f; done; source $ZSH_CUSTOM_CONF_FILES/aliases.zsh; +# Direnv setup +eval "$(direnv hook zsh)" + # Plugins # source ~/.config/zshplugins/zsh-autosuggestions/zsh-autosuggestions.plugin.zsh; -- cgit v1.3.1