aboutsummaryrefslogtreecommitdiff
path: root/config/zsh
diff options
context:
space:
mode:
authorAkshay Nair <phenax5@gmail.com>2022-03-03 23:09:03 +0530
committerAkshay Nair <phenax5@gmail.com>2022-03-03 23:09:03 +0530
commite160c24728bad4076f148b0a31de92f88df365d8 (patch)
tree3c8c2e9e75f189ba34f6e140319a74f511bf5c81 /config/zsh
parentbba9d09328c19d948914628666925510ee6abf88 (diff)
downloadnixos-config-e160c24728bad4076f148b0a31de92f88df365d8.tar.gz
nixos-config-e160c24728bad4076f148b0a31de92f88df365d8.zip
config sync
Diffstat (limited to '')
-rw-r--r--config/zsh/aliases/dev.zsh25
-rw-r--r--config/zsh/zshrc3
2 files changed, 28 insertions, 0 deletions
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;