aboutsummaryrefslogtreecommitdiff
path: root/config/zsh/aliases
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/aliases
parentbba9d09328c19d948914628666925510ee6abf88 (diff)
downloadnixos-config-e160c24728bad4076f148b0a31de92f88df365d8.tar.gz
nixos-config-e160c24728bad4076f148b0a31de92f88df365d8.zip
config sync
Diffstat (limited to 'config/zsh/aliases')
-rw-r--r--config/zsh/aliases/dev.zsh25
1 files changed, 25 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))'"
+